[Midnightbsd-cvs] src [7939] trunk/lib/libc/sys/fcntl.2: document cloexec
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Sep 14 17:39:28 EDT 2016
Revision: 7939
http://svnweb.midnightbsd.org/src/?rev=7939
Author: laffer1
Date: 2016-09-14 17:39:27 -0400 (Wed, 14 Sep 2016)
Log Message:
-----------
document cloexec
Modified Paths:
--------------
trunk/lib/libc/sys/fcntl.2
Modified: trunk/lib/libc/sys/fcntl.2
===================================================================
--- trunk/lib/libc/sys/fcntl.2 2016-09-14 21:36:45 UTC (rev 7938)
+++ trunk/lib/libc/sys/fcntl.2 2016-09-14 21:39:27 UTC (rev 7939)
@@ -28,7 +28,7 @@
.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94
.\" $MidnightBSD$
.\"
-.Dd September 28, 2009
+.Dd July 27, 2012
.Dt FCNTL 2
.Os
.Sh NAME
@@ -54,7 +54,7 @@
.Fn fcntl
can take an additional third argument
.Fa "int arg" .
-.Bl -tag -width F_GETOWNX
+.Bl -tag -width F_DUP2FD_CLOEXEC
.It Dv F_DUPFD
Return a new descriptor as follows:
.Pp
@@ -73,23 +73,44 @@
Same file status flags (i.e., both file descriptors
share the same file status flags).
.It
-The close-on-exec flag associated with the new file descriptor
-is set to remain open across
+The close-on-exec flag
+.Dv FD_CLOEXEC
+associated with the new file descriptor is cleared, so the file descriptor is
+to remain open across
.Xr execve 2
system calls.
.El
+.It Dv F_DUPFD_CLOEXEC
+Like
+.Dv F_DUPFD ,
+but the
+.Dv FD_CLOEXEC
+flag associated with the new file descriptor is set, so the file descriptor
+is closed when
+.Xr execve 2
+system call executes.
.It Dv F_DUP2FD
It is functionally equivalent to
.Bd -literal -offset indent
dup2(fd, arg)
.Ed
+.It Dv F_DU2PFD_CLOEXEC
+Like
+.Dv F_DUP2FD ,
+but the
+.Dv FD_CLOEXEC
+flag associated with the new file descriptor is set.
.Pp
The
.Dv F_DUP2FD
-constant is not portable, so it should not be used if portability is needed.
+and
+.Dv F_DUP2DF_CLOEXEC
+constants are not portable, so they should not be used if
+portability is needed.
Use
.Fn dup2
-instead.
+instead of
+.Dv F_DUP2FD .
.It Dv F_GETFD
Get the close-on-exec flag associated with the file descriptor
.Fa fd
More information about the Midnightbsd-cvs
mailing list