Re: Lack of Documentation about SA_RESTART...

2005-07-25 Thread Paolo Ornati
On Sun, 24 Jul 2005 10:56:08 -0400 Theodore Ts'o <[EMAIL PROTECTED]> wrote: > The spect says "unless otherwise specified". The description for > pause() states that the process will sleep until receiving a signal > that terminates the process or causes it to call signal-handling > function. That

Re: Lack of Documentation about SA_RESTART...

2005-07-24 Thread Theodore Ts'o
On Sat, Jul 23, 2005 at 05:30:42PM -0700, Linus Torvalds wrote: > On Mon, 11 Jul 2005, Theodore Ts'o wrote: > > > > According to the Single Unix Specification V3, all functions that > > return EINTR are supposed to restart if a process receives a signal > > where signal handler has been installed

Re: Lack of Documentation about SA_RESTART...

2005-07-24 Thread Paolo Ornati
On Sat, 23 Jul 2005 17:30:42 -0700 (PDT) Linus Torvalds <[EMAIL PROTECTED]> wrote: > > According to the Single Unix Specification V3, all functions that > > return EINTR are supposed to restart if a process receives a signal > > where signal handler has been installed with the SA_RESTART flag. >

Re: Lack of Documentation about SA_RESTART...

2005-07-23 Thread Linus Torvalds
On Mon, 11 Jul 2005, Theodore Ts'o wrote: > > According to the Single Unix Specification V3, all functions that > return EINTR are supposed to restart if a process receives a signal > where signal handler has been installed with the SA_RESTART flag. That can't be right. Some operations, like

Re: Lack of Documentation about SA_RESTART...

2005-07-13 Thread Paolo Ornati
On Tue, 12 Jul 2005 14:16:35 -0400 Theodore Ts'o <[EMAIL PROTECTED]> wrote: > Yes, do look at that. From the latest 2.6 sources: > > timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); > > if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { > /* Error code is set a

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Theodore Ts'o
On Tue, Jul 12, 2005 at 05:25:04PM +0200, Paolo Ornati wrote: > Hmmm... no, no. A connect() on non-blocking socket will NEVER return > EINTR. SUSV3 and Linux code agree. > > A syscall isn't magically interrupted if a signal arrives... it's the > syscall that must check for pending signals and do t

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Paolo Ornati
On Tue, 12 Jul 2005 08:04:56 -0400 Theodore Ts'o <[EMAIL PROTECTED]> wrote: > > > > The logically correct behaviur with blocking connect interrupted and > > then restarted should be to continue the blocking wait... IHMO. > > I was looking at what happened with a *non-blocking* connect > interrup

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Theodore Ts'o
On Tue, Jul 12, 2005 at 10:38:11AM +0200, Paolo Ornati wrote: > The particular case you analized (blocking connect interrupted by a > SA_RESTART signal) is interesting... and since SUSV3 says > "but the connection request shall not be aborted, and the connection > shall be established a

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Paolo Ornati
On Tue, 12 Jul 2005 10:38:11 +0200 Paolo Ornati <[EMAIL PROTECTED]> wrote: > The particular case you analized (blocking connect interrupted by a > SA_RESTART signal) is interesting... and since SUSV3 says > "but the connection request shall not be aborted, and the > connection shall be

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Paolo Ornati
On 11 Jul 2005 20:30:20 -0700 Philippe Troin <[EMAIL PROTECTED]> wrote: > Except for select() and poll(), which should always return EINTR even > when interrupted with a SA_RESTART signal. SUSV3 says this for select(): "If SA_RESTART has been set for the interrupting signal, it is implementation-

Re: Lack of Documentation about SA_RESTART...

2005-07-12 Thread Paolo Ornati
On Mon, 11 Jul 2005 10:34:27 -0400 Theodore Ts'o <[EMAIL PROTECTED]> wrote: > According to the Single Unix Specification V3, all functions that > return EINTR are supposed to restart if a process receives a signal > where signal handler has been installed with the SA_RESTART flag. Thanks to hav

Re: Lack of Documentation about SA_RESTART...

2005-07-11 Thread Philippe Troin
"Theodore Ts'o" <[EMAIL PROTECTED]> writes: > On Mon, Jul 11, 2005 at 12:32:37PM +0200, Paolo Ornati wrote: > > But what I'm looking for is a list of syscalls that are automatically > > restarted when SA_RESTART is set, and especially in what conditions. > > > > For example: read(), write(), open

Re: Lack of Documentation about SA_RESTART...

2005-07-11 Thread Theodore Ts'o
On Mon, Jul 11, 2005 at 12:32:37PM +0200, Paolo Ornati wrote: > But what I'm looking for is a list of syscalls that are automatically > restarted when SA_RESTART is set, and especially in what conditions. > > For example: read(), write(), open() are obviously restarted, but even > on non-blocking

Lack of Documentation about SA_RESTART...

2005-07-11 Thread Paolo Ornati
The documentation (man pages & info libc) doesn't cover well interaction between various syscalls and SA_RESTART flag of sigaction()... I wonder why! > MAN SIGACTION < "SA_RESTART Provide behaviour compatible with BSD signal semantics by making certain system calls restartable across sign