summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/recv.29
-rw-r--r--lib/libc/sys/socket.211
-rw-r--r--lib/libc/sys/socketpair.211
3 files changed, 27 insertions, 4 deletions
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index 74f275c..e0a1f04 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -28,7 +28,7 @@
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\" $FreeBSD$
.\"
-.Dd September 12, 2012
+.Dd March 19, 2013
.Dt RECV 2
.Os
.Sh NAME
@@ -121,11 +121,12 @@ argument to a
function is formed by
.Em or Ap ing
one or more of the values:
-.Bl -column ".Dv MSG_DONTWAIT" -offset indent
+.Bl -column ".Dv MSG_CMSG_CLOEXEC" -offset indent
.It Dv MSG_OOB Ta process out-of-band data
.It Dv MSG_PEEK Ta peek at incoming message
.It Dv MSG_WAITALL Ta wait for full request or error
.It Dv MSG_DONTWAIT Ta do not block
+.It Dv MSG_CMSG_CLOEXEC Ta set received fds close-on-exec
.El
.Pp
The
@@ -227,6 +228,10 @@ and
.Fa cmsg_type
set to
.Dv SCM_RIGHTS .
+The close-on-exec flag on received descriptors is set according to the
+.Dv MSG_CMSG_CLOEXEC
+flag passed to
+.Fn recvmsg .
.Pp
Process credentials can also be passed as ancillary data for
.Dv AF_UNIX
diff --git a/lib/libc/sys/socket.2 b/lib/libc/sys/socket.2
index 24e4293..74730be 100644
--- a/lib/libc/sys/socket.2
+++ b/lib/libc/sys/socket.2
@@ -28,7 +28,7 @@
.\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd December 7, 2012
+.Dd March 19, 2013
.Dt SOCKET 2
.Os
.Sh NAME
@@ -115,6 +115,15 @@ which is available only to the super-user, and
which is planned,
but not yet implemented, are not described here.
.Pp
+Additionally, the following flags are allowed in the
+.Fa type
+argument:
+.Pp
+.Bd -literal -offset indent -compact
+SOCK_CLOEXEC Set close-on-exec on the new descriptor,
+SOCK_NONBLOCK Set non-blocking mode on the new socket
+.Ed
+.Pp
The
.Fa protocol
argument
diff --git a/lib/libc/sys/socketpair.2 b/lib/libc/sys/socketpair.2
index c86db43..08d00d3 100644
--- a/lib/libc/sys/socketpair.2
+++ b/lib/libc/sys/socketpair.2
@@ -28,7 +28,7 @@
.\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd March 19, 2013
.Dt SOCKETPAIR 2
.Os
.Sh NAME
@@ -57,6 +57,14 @@ are returned in
and
.Fa sv Ns [1] .
The two sockets are indistinguishable.
+.Pp
+The
+.Dv SOCK_CLOEXEC
+and
+.Dv SOCK_NONBLOCK
+flags in the
+.Fa type
+argument apply to both descriptors.
.Sh RETURN VALUES
.Rv -std socketpair
.Sh ERRORS
@@ -79,6 +87,7 @@ process address space.
.Sh SEE ALSO
.Xr pipe 2 ,
.Xr read 2 ,
+.Xr socket 2 ,
.Xr write 2
.Sh HISTORY
The
OpenPOWER on IntegriCloud