aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2016-03-11 07:49:11 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2016-03-11 07:49:11 +0100
commit7255c7c0dfbbacdbca03a53f1cd4563e781627af (patch)
treea5e6065e511e169514b9ba9985acab168054c430
parent501934a934566c14b077fe68fc521de2cef76917 (diff)
downloadman-pages-7255c7c0dfbbacdbca03a53f1cd4563e781627af.tar.gz
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 <jason.vas.dias@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/fcntl.231
1 files changed, 17 insertions, 14 deletions
diff --git a/man2/fcntl.2 b/man2/fcntl.2
index d8e09247b8..dc487a8974 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