
Oliver.Kowalke@infineon.com wrote:
sig::action sa; [--snip--]
if ( ::sigaction( SIGPIPE, & sa, & old_sa) < 0) throw std::runtime_error( ::strerror( errno) );
// shared_ptr has to call ::sigaction( SIGPIPE, & old_sa, 0) in order to
// reset original signal handler
So it seams to be only 3 clib-function calls for each write operation.
I'm aware that this wouldn't be needed for Linux, but I just though add something... My Linux man page says that sigaction is a *system* call, and I would guess that it's the same on most Unixes -- indeed a quick google seems to indicate that this is also the case for SunOS/Solaris (at least the function is listed in the "system calls" section). System calls can be hideously expensive compared to regular C library function calls depending on architecture. -- Bardur Arantsson <bardurREMOVE@THISimada.sdu.dk> <bardurREMOVE@THISscientician.net> - That plot makes perfect sense. Wink, wink - Bender, you said "wink, wink" out loud. - No, I didn't. Raise middle finger. Bender and Zoidberg / Futurama