Re: spawn-pipe: close() EINTR handling

2013-07-03 Thread Pádraig Brady
On 07/03/2013 01:46 PM, Eric Blake wrote: > On 07/03/2013 05:26 AM, Pádraig Brady wrote: >> So I was reading http://austingroupbugs.net/view.php?id=529 >> which states on Linux that one shouldn't retry close() after EINTR >> as the descriptor is already closed in that

Re: spawn-pipe: close() EINTR handling

2013-07-03 Thread Eric Blake
On 07/03/2013 05:26 AM, Pádraig Brady wrote: > So I was reading http://austingroupbugs.net/view.php?id=529 > which states on Linux that one shouldn't retry close() after EINTR > as the descriptor is already closed in that case > and another thread could reuse the descriptor > w

spawn-pipe: close() EINTR handling

2013-07-03 Thread Pádraig Brady
So I was reading http://austingroupbugs.net/view.php?id=529 which states on Linux that one shouldn't retry close() after EINTR as the descriptor is already closed in that case and another thread could reuse the descriptor which a retried close() would close erroneously. That suggests tha

Re: EINTR

2011-07-05 Thread Bruno Haible
Hi, More details about this: > 3) On MacOS X, SIGSTOP and SIGCONT make not only read() fail with EINTR, but >fread() as well. > >Test case: [3]. Run it, type Hello then Ctrl-Z then fg. Result is: > >$ ./a.out >Hello >^Z >[1]+ Stopped

Re: EINTR

2011-07-05 Thread Bastien ROUCARIES
On Tue, Jul 5, 2011 at 10:17 AM, Paolo Bonzini wrote: > On 07/03/2011 06:28 PM, Bastien ROUCARIES wrote: >> On Sun, Jul 3, 2011 at 5:36 PM, Bruno Haible  wrote: >>> Hi all, >>> >>> I wrote: >>>> ... in programs that don't install signal

Re: EINTR

2011-07-05 Thread Paolo Bonzini
On 07/03/2011 06:28 PM, Bastien ROUCARIES wrote: > On Sun, Jul 3, 2011 at 5:36 PM, Bruno Haible wrote: >> Hi all, >> >> I wrote: >>> ... in programs that don't install signal handlers, EINTR ... also occurs in >>> MacOS X! >> >> It is worse

Re: EINTR

2011-07-03 Thread Bastien ROUCARIES
On Sun, Jul 3, 2011 at 5:36 PM, Bruno Haible wrote: > Hi all, > > I wrote: >> ... in programs that don't install signal handlers, EINTR ... also occurs in >> MacOS X! > > It is worse than that: > > 1) Even on Linux, even when the signal handlers have the SA_

Re: EINTR

2011-07-03 Thread Bruno Haible
Hi all, I wrote: > ... in programs that don't install signal handlers, EINTR ... also occurs in > MacOS X! It is worse than that: 1) Even on Linux, even when the signal handlers have the SA_RESTART flag set, some system call (like msgrcv(), but not read()) can fail with EINTR.

EINTR

2011-07-03 Thread Bruno Haible
Ralf Wildenhues wrote: > In the first example using 'read', don't you have to take care of EINTR > so that './mycat9 < file' doesn't drop forget half the file after being > suspended and continued again? Excellent point. I thought that in programs tha