Adding an option to avoid SIGPIPE for all file descriptors

2012-01-23 Thread Christos Zoulas
Hello, In most programs the delivery of SIGPIPE (typically when one side of a socket or pipe closes and the other side tries to write) is annoying to handle, and the only solution to avoid it is to have the main program do signal(SIGPIPE, SIG_IGN), so the the system calls set errno = EPIPE instea

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

2012-01-23 Thread David Holland
On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: > [stuff] One thing jumps out at me: if it's a file-level flag, shouldn't it be sufficient to use F_GETFL / F_SETFL to manipulate it, rather than adding new fcntls? -- David A. Holland dholl...@netbsd.org

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

2012-01-23 Thread Matt Thomas
On Jan 23, 2012, at 7:07 PM, David Holland wrote: > On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: >> [stuff] > > One thing jumps out at me: if it's a file-level flag, shouldn't it be > sufficient to use F_GETFL / F_SETFL to manipulate it, rather than > adding new fcntls? That

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

2012-01-23 Thread YAMAMOTO Takashi
hi, > Hello, > > In most programs the delivery of SIGPIPE (typically when one side > of a socket or pipe closes and the other side tries to write) is > annoying to handle, and the only solution to avoid it is to have > the main program do signal(SIGPIPE, SIG_IGN), so the the system > calls set er

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

2012-01-23 Thread Thor Lancelot Simon
On Tue, Jan 24, 2012 at 03:07:45AM +, David Holland wrote: > On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: > > [stuff] > > One thing jumps out at me: if it's a file-level flag, shouldn't it be > sufficient to use F_GETFL / F_SETFL to manipulate it, rather than > adding new

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

2012-01-23 Thread Christos Zoulas
On Jan 24, 3:07am, dholland-t...@netbsd.org (David Holland) wrote: -- Subject: Re: Adding an option to avoid SIGPIPE for all file descriptors | On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: | > [stuff] | | One thing jumps out at me: if it's a file-level flag, shouldn

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

2012-01-23 Thread Steven Bellovin
> 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

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

2012-01-23 Thread Matt Thomas
On Jan 23, 2012, at 7:58 PM, 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 p

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

2012-01-23 Thread David Holland
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 >

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

2012-01-24 Thread David Laight
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 > >

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

2012-01-24 Thread Christos Zoulas
On Jan 24, 3:20am, y...@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote: -- Subject: Re: Adding an option to avoid SIGPIPE for all file descriptors | please don't forget compat_netbsd32 copy. I don't see anything to do there? What should I do? Thanks, christos

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

2012-01-24 Thread David Holland
On Mon, Jan 23, 2012 at 10:43:38PM -0500, Christos Zoulas wrote: > | On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: > | > [stuff] > | > | One thing jumps out at me: if it's a file-level flag, shouldn't it be > | sufficient to use F_GETFL / F_SETFL to manipulate it, rather t

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

2012-01-24 Thread Christos Zoulas
On Jan 24, 5:19pm, dholland-t...@netbsd.org (David Holland) wrote: -- Subject: Re: Adding an option to avoid SIGPIPE for all file descriptors | On Mon, Jan 23, 2012 at 10:43:38PM -0500, Christos Zoulas wrote: | > | On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wr

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

2012-01-24 Thread Michael van Elst
t...@panix.com (Thor Lancelot Simon) writes: >On Tue, Jan 24, 2012 at 03:07:45AM +, David Holland wrote: >> On Mon, Jan 23, 2012 at 09:28:48PM -0500, Christos Zoulas wrote: >> > [stuff] >> >> One thing jumps out at me: if it's a file-level flag, shouldn't it be >> sufficient to use F_GETFL /

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

2012-01-24 Thread Rhialto
On Tue 24 Jan 2012 at 21:33:44 +, Michael van Elst wrote: > Unfortunately noone did ever think about a SIGNOSPACE and that's > why every Unix system now requires an infinite disk. Well, that does sound like a resource limit being exceeded, so why not send 25SIGXFSZ terminate pr

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

2012-01-24 Thread YAMAMOTO Takashi
hi, > On Jan 24, 3:20am, y...@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote: > -- Subject: Re: Adding an option to avoid SIGPIPE for all file descriptors > > | please don't forget compat_netbsd32 copy. > > I don't see anything to do there? What should I do? i mea

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

2012-01-25 Thread Steven Bellovin
On Jan 24, 2012, at 3:26 41AM, David Laight wrote: > 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

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

2012-01-25 Thread Steven Bellovin
On Jan 23, 2012, at 11:05 58PM, Matt Thomas wrote: > > On Jan 23, 2012, at 7:58 PM, 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 h

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

2012-01-25 Thread David Holland
On Tue, Jan 24, 2012 at 02:04:58PM -0500, Christos Zoulas wrote: > | (and I don't suppose we can think of a clever way to stuff the compat > | fcntls into libcompat or some such place so they don't bloat out the > | core system...) > > The compat fcntls, are just 8 lines of code. > > #defi

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

2012-01-25 Thread Matthew Mondor
On Wed, 25 Jan 2012 12:25:46 -0500 Steven Bellovin wrote: > > On Jan 23, 2012, at 11:05 58PM, Matt Thomas wrote: > > > > > On Jan 23, 2012, at 7:58 PM, Steven Bellovin wrote: > > > >>> I also wonder whether we should also have a note that disabled SIGPIPE. > >>> similar to what paxctl does. >