• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SIGPIPE and SIG_IGN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPIPE and SIG_IGN


  • Subject: Re: SIGPIPE and SIG_IGN
  • From: Glenn Anderson <email@hidden>
  • Date: Tue, 19 Jun 2007 11:25:25 +1200

At 4:09 pm -0700 18/6/2007, email@hidden wrote:
Hello, all ...

In my adventures of making our app also work on Mac OSX (10.4.9, Intel and PPC), i've discovered that I occasionally get SIGPIPE signals. This would be fine, except that I specifically ignore them like this:

    // set up our signal handlers

    signal( SIGINT, signal_handler );
    signal( SIGTERM, signal_handler );

#ifndef WIN32
    signal( SIGPIPE, SIG_IGN );
#endif

... so my question is: why do I still get SIGPIPE signals, which make my program go boom? What else do I need to do such that SIGPIPE is actually ignored? I don't _always_ get them, but they come up often enough to be a problem.

SIGPIPE is a per-thread signal, so you need to do signal( SIGPIPE, SIG_IGN ) on every thread dealing with the relevant sockets. Alternatively you can use setsockopt() with SOL_SOCKET and SO_NOSIGPIPE to turn off SIGPIPE for a socket.


Glenn.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: SIGPIPE and SIG_IGN
      • From: Terry Lambert <email@hidden>
References: 
 >SIGPIPE and SIG_IGN (From: email@hidden)

  • Prev by Date: SIGPIPE and SIG_IGN
  • Next by Date: Re: SIGPIPE and SIG_IGN
  • Previous by thread: SIGPIPE and SIG_IGN
  • Next by thread: Re: SIGPIPE and SIG_IGN
  • Index(es):
    • Date
    • Thread