summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/accept.2
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-03-26 22:46:56 +0000
committerjilles <jilles@FreeBSD.org>2013-03-26 22:46:56 +0000
commite69d25bd006ff10869b332172e15896bad52845d (patch)
tree8372b10a1fb6473be9ae69237e6e4f40db67033b /lib/libc/sys/accept.2
parent52767ea66d6dd421d987a4d140b6de1591f5c3f5 (diff)
downloadFreeBSD-src-e69d25bd006ff10869b332172e15896bad52845d.zip
FreeBSD-src-e69d25bd006ff10869b332172e15896bad52845d.tar.gz
accept(2): Mention inheritance of O_ASYNC and signal destination.
While almost nobody uses O_ASYNC, and rightly so, the inheritance of the related properties across accept() is a portability issue like the inheritance of O_NONBLOCK.
Diffstat (limited to 'lib/libc/sys/accept.2')
-rw-r--r--lib/libc/sys/accept.216
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index df6c0b1..978b948 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -28,7 +28,7 @@
.\" @(#)accept.2 8.2 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd December 11, 1993
+.Dd March 26, 2013
.Dt ACCEPT 2
.Os
.Sh NAME
@@ -57,7 +57,13 @@ queue of pending connections, creates a new socket,
and allocates a new file descriptor for the socket which
inherits the state of the
.Dv O_NONBLOCK
-property from the original socket
+and
+.Dv O_ASYNC
+properties and the destination of
+.Dv SIGIO
+and
+.Dv SIGURG
+signals from the original socket
.Fa s .
.Pp
If no pending connections are
@@ -129,7 +135,11 @@ to pre-process incoming connections.
.Pp
Portable programs should not rely on the
.Dv O_NONBLOCK
-property being inherited.
+and
+.Dv O_ASYNC
+properties and the signal destination being inherited,
+but should set them explicitly using
+.Xr fcntl 2 .
.Sh RETURN VALUES
The call returns \-1 on error.
If it succeeds, it returns a non-negative
OpenPOWER on IntegriCloud