• 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 problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPIPE problems


  • Subject: Re: SIGPIPE problems
  • From: Vincent Lubet <email@hidden>
  • Date: Fri, 15 Mar 2002 12:14:50 -0800

On Friday, March 15, 2002, at 10:53 AM, Chilton Webb wrote:

I was under the impression that you could ignore sigpipes and use the returned error (epipe) from a write to perform some action (like stop writing to that socket)

My code thus far does this...

signal(SIGPIPE,SIG_IGN);

/*then, later...*/

nwritten = write(fd, Zero, nleft);


Now, when the socket at fd breaks, I get a SIGPIPE error. I was under the impression that the call to signal would force that error to be ignored. I'm not making any other calls to signal (afaik), so what gives?

This is preventing a signal to be delivered to your process -- the default action for SIGPIPE is to kill your process -- and instead you just need to deal with EPIPE.

By the way, you should also deal with error EINTR from any system call.

Vincent
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >SIGPIPE problems (From: Chilton Webb <email@hidden>)

  • Prev by Date: Re: Setting the default web browser
  • Next by Date: Non Carbon OT APIs?
  • Previous by thread: SIGPIPE problems
  • Next by thread: Non Carbon OT APIs?
  • Index(es):
    • Date
    • Thread