mirror of https://github.com/mkerrisk/man-pages
select.2: Move mislocated text describing the self-pipe text from BUGS to NOTES
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
8b58a9d467
commit
3116bbe074
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue