Noted that timeout can also be changed is select() is interrupted by a signal.

This commit is contained in:
Michael Kerrisk 2007-06-16 10:46:33 +00:00
parent 865be3ccca
commit 5766b19637
1 changed files with 15 additions and 3 deletions

View File

@ -446,9 +446,21 @@ in which a file descriptor is spuriously reported as ready.
.\" returns successfully because of an intervening RST from the client.
Thus it may be safer to use O_NONBLOCK on sockets that should not block.
.\" Maybe the kernel should have returned EIO in such a situation?
.\"
.\" FIXME select() (and pselect()?) also modify the timeout
.\" on an EINTR error return; POSIX.1-2001 doesn't permit this.
On Linux,
.BR select ()
also modifies
.I timeout
if the call is interrupted by a signal handler (i.e., the
.B EINTR
error return).
This is not permitted by POSIX.1-2001.
The Linux
.BR pselect (2)
system call has the same behavior,
but the glibc wrapper hides this behavior by internally copying the
.I timeout
to a local variable and passing that variable to the system call.
.SH EXAMPLE
.nf
#include <stdio.h>