close.2: Add mention of the close-on-exec flag

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-09-12 13:54:38 +01:00
parent cfa21a0b8f
commit 81554da338
1 changed files with 7 additions and 0 deletions

View File

@ -113,6 +113,13 @@ the data is physically stored on the underlying disk, use
.BR fsync (2).
(It will depend on the disk hardware at this point.)
.PP
The close-on-exec file descriptor flag can be used to ensure
that a file descriptor is automatically closed upon a successful
.BR execve (2);
see
.BR fcntl (2)
for details.
.PP
It is probably unwise to close file descriptors while
they may be in use by system calls in
other threads in the same process.