Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-08-28 Thread Roland McGrath
In POSIX, select/pselect is specifically exempted from the usual SA_RESTART behavior. I'm not really sure if that is entirely historical or because after a handler has run even an adjusted relative timeout may no longer be what you actually want. There is no such exemption for poll/ppoll, though

Re: [PATCH] Use ERESTART_RESTARTBLOCK if poll() is interrupted by a signal (was: Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal)

2007-08-04 Thread Oleg Nesterov
On 08/03, Chris Wright wrote: > > +long do_restart_poll(struct restart_block *restart_block) > +{ > + struct pollfd __user *ufds = (struct pollfd __user*)restart_block->arg0; > + int nfds = restart_block->arg1; > + s64 timeout = ((s64)restart_block->arg3<<32) | (s64)restart_block->arg2;

[PATCH] Use ERESTART_RESTARTBLOCK if poll() is interrupted by a signal (was: Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal)

2007-08-03 Thread Chris Wright
* Oleg Nesterov ([EMAIL PROTECTED]) wrote: > What we need is ERESTART_RESTARTBLOCK, and restart_block.arg2 should > have the new timeout value, which takes the time we already slept > into account. This passes my simple 32-bit and 64-bit testing. See any issues with this one? thanks, -chris --

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-31 Thread Oleg Nesterov
On 07/31, Manfred Spraul wrote: > > Mainline has the same problem: poll() returns to user space if it's > interrupted by SIGSTOP/SIGCONT. > >I guess the consequences of the thing-which-this-fixes aren't huge, s I ca > >queue this up for 2.6.24, after Oleg's > >do_poll-return-eintr-when-signalled.p

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-31 Thread Manfred Spraul
Andrew Morton wrote: On Sun, 29 Jul 2007 19:05:05 +0200 Manfred Spraul <[EMAIL PROTECTED]> wrote: Hi Andrew, poll() returns -EINTR if a signal is pending. EINTR is a bad choice: it means that poll returns to user space if the task is stopped by SIGSTOP/SIGCONT or by the freezer. select() an

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-31 Thread Chris Wright
* Oleg Nesterov ([EMAIL PROTECTED]) wrote: > > I am not sure. This means we restart sys_poll() with the same timeout > > if there is no pending signal. I think we need ERESTART_RESTARTBLOCK > > logic. > > Forgot to mention, sys_select() can use ERESTARTNOHAND because it > modifies "struct timeval

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-30 Thread Oleg Nesterov
On 07/31, Oleg Nesterov wrote: > > > Manfred Spraul <[EMAIL PROTECTED]> wrote: > > > > > poll() returns -EINTR if a signal is pending. > > > EINTR is a bad choice: it means that poll returns to user space if the > > > task is stopped by SIGSTOP/SIGCONT or by the freezer. > > > select() and ppoll()

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-30 Thread Oleg Nesterov
On 07/30, Andrew Morton wrote: > > On Sun, 29 Jul 2007 19:05:05 +0200 > Manfred Spraul <[EMAIL PROTECTED]> wrote: > > > Hi Andrew, > > > > poll() returns -EINTR if a signal is pending. > > EINTR is a bad choice: it means that poll returns to user space if the > > task is stopped by SIGSTOP/SIGCON

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-30 Thread Chris Wright
* Andrew Morton ([EMAIL PROTECTED]) wrote: > On Sun, 29 Jul 2007 19:05:05 +0200 Manfred Spraul <[EMAIL PROTECTED]> wrote: > > poll() returns -EINTR if a signal is pending. > > EINTR is a bad choice: it means that poll returns to user space if the > > task is stopped by SIGSTOP/SIGCONT or by the fre

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-30 Thread Chris Wright
* Manfred Spraul ([EMAIL PROTECTED]) wrote: > poll() returns -EINTR if a signal is pending. > EINTR is a bad choice: it means that poll returns to user space if the > task is stopped by SIGSTOP/SIGCONT or by the freezer. > select() and ppoll() both use ERESTARTNOHAND, this avoids a return to > user

Re: [PATCH] Use ERESTARTNOHAND if poll() is interrupted by a signal

2007-07-30 Thread Andrew Morton
On Sun, 29 Jul 2007 19:05:05 +0200 Manfred Spraul <[EMAIL PROTECTED]> wrote: > Hi Andrew, > > poll() returns -EINTR if a signal is pending. > EINTR is a bad choice: it means that poll returns to user space if the > task is stopped by SIGSTOP/SIGCONT or by the freezer. > select() and ppoll() both