diff --git a/man2/select.2 b/man2/select.2 index ee42ef259..44580f144 100644 --- a/man2/select.2 +++ b/man2/select.2 @@ -407,6 +407,19 @@ Portable programs may wish to check for and loop, just as with .BR EINTR . +On systems that lack +.BR pselect (), +reliable (and more portable) signal trapping can be achieved +using the self-pipe trick. +In this technique, +a signal handler writes a byte to a pipe whose other end +is monitored by +.BR select () +in the main program. +(To avoid possibly blocking when writing to a pipe that may be full +or reading from a pipe that may be empty, +nonblocking I/O is used when reading from and writing to the pipe.) + Concerning the types involved, the classical situation is that the two fields of a .I timeval @@ -577,19 +590,6 @@ Modern versions of glibc use the (race-free) .BR pselect () system call on kernels where it is provided. -On systems that lack -.BR pselect (), -reliable (and more portable) signal trapping can be achieved -using the self-pipe trick. -In this technique, -a signal handler writes a byte to a pipe whose other end -is monitored by -.BR select () -in the main program. -(To avoid possibly blocking when writing to a pipe that may be full -or reading from a pipe that may be empty, -nonblocking I/O is used when reading from and writing to the pipe.) - Under Linux, .BR select () may report a socket file descriptor as "ready for reading", while