Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPIPE and SIG_IGN



Title: Re: SIGPIPE and SIG_IGN
At 5:30 pm -0700 18/6/2007, Terry Lambert wrote:
This also means that the signal will not get sent if you are ignoring it, and it's in your process signal mask (sigaction() is generally preferred to calling signal(), but either should work).

Near the end of signal.h there is this:
/*
 *    signals delivered on a per-thread basis.
 */

#define threadmask (sigmask(SIGILL)|sigmask(SIGTRAP)|\
                   sigmask(SIGIOT)|sigmask(SIGEMT)|\
               sigmask(SIGFPE)|sigmask(SIGBUS)|\
               sigmask(SIGSEGV)|sigmask(SIGSYS)|\
              sigmask(SIGPIPE))

Is this not true?

It is has been my experience that if you want to ignore SIGPIPE, you have to ignore it on every thread that could trigger it (ie: call signal(SIGPIPE, SIG_IGN) on every thread that writes to sockets that could close), you can't just ignore it for the whole process.

Glenn.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >SIGPIPE and SIG_IGN (From: email@hidden)
 >Re: SIGPIPE and SIG_IGN (From: Glenn Anderson <email@hidden>)
 >Re: SIGPIPE and SIG_IGN (From: Terry Lambert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.