fcntl.2: Note an F_SETSIG corner case

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-05-04 13:48:39 +02:00
parent 9a06730f49
commit caf997afa0
1 changed files with 13 additions and 0 deletions

View File

@ -931,6 +931,19 @@ with
.B O_NONBLOCK
set etc.) to determine which file descriptors are available for I/O.
Note that the file descriptor provided in
.I si_fd
is the one that that was specified during the
.BR F_SETSIG
operation.
This can lead to an unusual corner case.
If the file descriptor is duplicated
.RB ( dup (2)
or similar), and the original file descriptor is closed,
then I/O events will continue to be generated, but the
.I si_fd
field will contain the number of the now closed file descriptor.
By selecting a real time signal (value >=
.BR SIGRTMIN ),
multiple I/O events may be queued using the same signal numbers.