tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Detecting parent's termination



On Tue, Jan 31, 2012 at 12:38:40PM +0100, Emmanuel Dreyfus wrote:
> I just made a test case, writing to a closed SOCK_STREAM socket yields a
> SIGPIPE, while the same test with SOCK_SEQPACKET does not. That is a
> bug.

I was wrong: SOCK_SEQPACKET also fires a SIGPIPE, but the difference is
that when doing a write(2), it returns immediatly, while SOCK_STREAM seems 
to return when the other side dies or consume the data. Due to the way
my test case was written, I did not see the SIGPIPE with SOCK_SEQPACKET
because the process terminated too early.

This leads to another question: is it fine that write() on SOCK_SEQPACKET
is by default in non blocking mode?

-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index