|
Boost : |
From: Bardur Arantsson (spam_at_[hidden])
Date: 2005-12-13 02:54:58
Oliver.Kowalke_at_[hidden] 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_at_[hidden]> <bardurREMOVE_at_[hidden]> - 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk