Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 8/1/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > I'm not quite sure you are right Ulrich. Given this little bit from > SUSv3 about SA_RESTART in the page describing sigaction ( > http://www.opengroup.org/onlinepubs/009695399/functions/sigaction.html > ) : It's not an official SA_RESTART since

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Jesper Juhl
On 8/1/05, Dave Airlie <[EMAIL PROTECTED]> wrote: > > > > However, there is in fact no bug here. The test program is just wrong. > > sigwait returns zero or an error number, as POSIX specifies. Conversely, > > sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. > > It is odd

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Roland McGrath
> But sigwait is not a function specified with an EINTR error number. > As I said before, this does not mean that EINTR cannot be returned. > But it will create havoc among programs and it causes undefined > behavior wrt to SA_RESTART. I think it is best to not have any > function for which

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 7/31/05, Roland McGrath <[EMAIL PROTECTED]> wrote: > However, there is in fact no bug here. The test program is just wrong. > sigwait returns zero or an error number, as POSIX specifies. No question, no error is detected incorrectly. But sigwait is not a function specified with an EINTR

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 7/31/05, Roland McGrath [EMAIL PROTECTED] wrote: However, there is in fact no bug here. The test program is just wrong. sigwait returns zero or an error number, as POSIX specifies. No question, no error is detected incorrectly. But sigwait is not a function specified with an EINTR error

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Roland McGrath
But sigwait is not a function specified with an EINTR error number. As I said before, this does not mean that EINTR cannot be returned. But it will create havoc among programs and it causes undefined behavior wrt to SA_RESTART. I think it is best to not have any function for which EINTR is

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Jesper Juhl
On 8/1/05, Dave Airlie [EMAIL PROTECTED] wrote: However, there is in fact no bug here. The test program is just wrong. sigwait returns zero or an error number, as POSIX specifies. Conversely, sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. It is odd that the

Re: Fw: sigwait() breaks when straced

2005-08-01 Thread Ulrich Drepper
On 8/1/05, Jesper Juhl [EMAIL PROTECTED] wrote: I'm not quite sure you are right Ulrich. Given this little bit from SUSv3 about SA_RESTART in the page describing sigaction ( http://www.opengroup.org/onlinepubs/009695399/functions/sigaction.html ) : It's not an official SA_RESTART since the

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Dave Airlie
> > However, there is in fact no bug here. The test program is just wrong. > sigwait returns zero or an error number, as POSIX specifies. Conversely, > sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. > It is odd that the interfaces of related functions differ in this

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Roland McGrath
The problem is not really "when straced", but when strace attaches. In fact, it's not even "when PTRACE_ATTACH'd". It's actually the implicit SIGSTOP that PTRACE_ATTACH causes. If you simply suspend and resume the program (with SIGSTOP or C-z), you get the same result. So this report is more

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Roland McGrath
The problem is not really when straced, but when strace attaches. In fact, it's not even when PTRACE_ATTACH'd. It's actually the implicit SIGSTOP that PTRACE_ATTACH causes. If you simply suspend and resume the program (with SIGSTOP or C-z), you get the same result. So this report is more

Re: Fw: sigwait() breaks when straced

2005-07-31 Thread Dave Airlie
However, there is in fact no bug here. The test program is just wrong. sigwait returns zero or an error number, as POSIX specifies. Conversely, sigtimedwait and sigwaitinfo either return 0 or set errno and return -1. It is odd that the interfaces of related functions differ in this way,