From bbeb5403be5330b145ad01ccdbfa305d3bf8a76d Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 26 Jun 2011 16:42:39 +0000 Subject: * 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. --- include/unistd.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/unistd.h b/include/unistd.h index 32dbb29adfe..f9d5b669ce7 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.125 2011/01/19 19:21:29 christos Exp $ */ +/* $NetBSD: unistd.h,v 1.126 2011/06/26 16:42:40 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -300,6 +300,7 @@ int acct(const char *); int closefrom(int); int des_cipher(const char *, char *, long, int); int des_setkey(const char *); +int dup3(int, int, int); void endusershell(void); int exect(const char *, char * const *, char * const *); int fchroot(int); @@ -315,11 +316,12 @@ int initgroups(const char *, gid_t); int iruserok(uint32_t, int, const char *, const char *); int issetugid(void); int nfssvc(int, void *); +int pipe2(int *, int); int profil(char *, size_t, u_long, u_int); #ifndef __PSIGNAL_DECLARED #define __PSIGNAL_DECLARED /* also in signal.h */ -void psignal(int, const char *); +void psignal(int, const char *); #endif /* __PSIGNAL_DECLARED */ int rcmd(char **, int, const char *, const char *, const char *, int *); int reboot(int, char *); -- cgit