tech-kern archive

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

Re: Adding an option to avoid SIGPIPE for all file descriptors



On Mon, Jan 23, 2012 at 10:58:59PM -0500, Steven Bellovin wrote:
> > I also wonder whether we should also have a note that disabled SIGPIPE.
> > similar to what paxctl does.
> > 
> You mean a system-wide flag?  That would worry me; I think it would have
> bad effects, since anything that did
> 
>       a | b 
> 
> would be liable to cause infinite loops if 'a' didn't check the return
> code on the write() or printf() or what have you -- and such programs are
> very common.

I think that is why SIGPIPE exists (but I suspect some shells disable
it because I've sometimes seen - but not investigated - programs
not exiting).

In generate you want that behaviour for shell pipelines, and probably
don't want it anywhere else.

OTOH I've NFI when/why the 'feature' got attached to TCP sockets.
I don't remember it appliying to SYSV.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index