diff options
| author | christos <christos@NetBSD.org> | 2011-06-26 16:42:39 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2011-06-26 16:42:39 +0000 |
| commit | bbeb5403be5330b145ad01ccdbfa305d3bf8a76d (patch) | |
| tree | d1be829e69cabc22b138aada13975946ca6ac102 /lib/libc/stdio/fopen.3 | |
| parent | 8b2572853f09a752d637652a9e7abb15ea88c254 (diff) | |
* Arrange for interfaces that create new file descriptors to be able to
set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).
- Add F_DUPFD_CLOEXEC to fcntl(2).
- Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
- Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
- Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
- Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
for socket(2) and socketpair(2).
- Add new paccept(2) syscall that takes an additional sigset_t to alter
the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
SOCK_NONBLOCK.
- Add new mode character 'e' to fopen(3) and popen(3) to open pipes
and file descriptors for close on exec.
- Add new kqueue1(2) syscall with a new flags argument to open the
kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.
* Fix the system calls that take socklen_t arguments to actually do so.
* Don't include userland header files (signal.h) from system header files
(rump_syscallargs.h).
* Bump libc version for the new syscalls.
Diffstat (limited to 'lib/libc/stdio/fopen.3')
| -rw-r--r-- | lib/libc/stdio/fopen.3 | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/libc/stdio/fopen.3 b/lib/libc/stdio/fopen.3 index ad897b6ab36..b17ae124a12 100644 --- a/lib/libc/stdio/fopen.3 +++ b/lib/libc/stdio/fopen.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: fopen.3,v 1.24 2010/04/05 21:34:47 joerg Exp $ +.\" $NetBSD: fopen.3,v 1.25 2011/06/26 16:42:41 christos Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" -.Dd June 4, 1993 +.Dd June 24, 2011 .Dt FOPEN 3 .Os .Sh NAME @@ -84,14 +84,20 @@ The file is created if it does not exist. .Pp The .Fa mode -string can also include the letter ``b'' either as a last character or +string can also include the letter +.Dq b +either as a last character or as a character between the characters in any of the two-character strings described above. This is strictly for compatibility with .St -ansiC -and has no effect; the ``b'' is ignored. +and has no effect; the +.Dq b +is ignored. .Pp -The letter ``f'' in the mode string restricts fopen to regular +The letter +.Dq f +in the mode string restricts fopen to regular files; if the file opened is not a regular file, .Fn fopen will fail. @@ -99,6 +105,16 @@ This is a non .St -ansiC extension. .Pp +the letter +.Dq e +in the mode string sets the close-on-exec flag in the file descriptors of +the newly opened file files; if the operation fails, +.Fn fopen +will fail. +This is a non +.St -ansiC +extension. +.Pp Any created files will have mode .Pf \*q Dv S_IRUSR \&| |
