From 7255c7c0dfbbacdbca03a53f1cd4563e781627af Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 11 Mar 2016 07:49:11 +0100 Subject: [PATCH] fcntl.2: Rework description of F_SETOWN As suggested by Jason, make it clearer that I/O signalling requires the use of both F_SETOWN and O_ASYNC. While we're at, make a few other cleanups to the text. Reported-by: Jason Vas Dias Signed-off-by: Michael Kerrisk --- man2/fcntl.2 | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index d8e09247b..dc487a897 100644 --- a/man2/fcntl.2 +++ b/man2/fcntl.2 @@ -681,9 +681,9 @@ Set the process ID or process group ID that will receive .B SIGIO and .B SIGURG -signals for events on file descriptor -.IR fd -to the ID given in +signals for events on the file descriptor +.IR fd . +The target process or process group ID is specified in .IR arg . A process ID is specified as a positive value; a process group ID is specified as a negative value. @@ -693,22 +693,23 @@ Most commonly, the calling process specifies itself as the owner is specified as .BR getpid (2)). -.\" From glibc.info: -If you set the -.B O_ASYNC -status flag on a file descriptor by using the +As well as setting the file descriptor owner, +one must also enable generation of signals on the file descriptor. +This is done by using the +.BR fcntl () .B F_SETFL -command of -.BR fcntl (), -a +command to set the +.B O_ASYNC +file status flag on the file descriptor. +Subsequently, a .B SIGIO signal is sent whenever input or output becomes possible -on that file descriptor. +on the file descriptor. +The +.BR fcntl () .B F_SETSIG -can be used to obtain delivery of a signal other than +command can be used to obtain delivery of a signal other than .BR SIGIO . -If this permission check fails, then the signal is -silently discarded. Sending a signal to the owner process (group) specified by .B F_SETOWN @@ -717,6 +718,8 @@ is subject to the same permissions checks as are described for where the sending process is the one that employs .B F_SETOWN (but see BUGS below). +If this permission check fails, then the signal is +silently discarded. If the file descriptor .I fd