aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-21 15:22:51 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-05-21 15:22:51 -0700
commitded7408767c5c2b1d21386efff594bf369380fa8 (patch)
treed70c4112a471c94d30d6e9b18928478cf2ca357f
parent5203298c5af47a7aaaa91c4d738463be62fd5ab4 (diff)
downloadklibc-ded7408767c5c2b1d21386efff594bf369380fa8.tar.gz
[klibc] Add pipe2() system call
pipe2() is like pipe() except we can set the O_CLOEXEC flag via a second argument. Unlike pipe(), noone seems to have seemed fit to create a completely ad hoc calling convention for pipe2(), so we can just define it in one simple place. Thank goodness. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/include/unistd.h1
-rw-r--r--usr/klibc/SYSCALLS.def1
2 files changed, 2 insertions, 0 deletions
diff --git a/usr/include/unistd.h b/usr/include/unistd.h
index 3244e21c34e1c3..3af4c8f16dacb9 100644
--- a/usr/include/unistd.h
+++ b/usr/include/unistd.h
@@ -71,6 +71,7 @@ __extern int mkdir(const char *, mode_t);
__extern int mkdirat(int, const char *, const char *, mode_t);
__extern int rmdir(const char *);
__extern int pipe(int *);
+__extern int pipe2(int *, int);
__extern int chroot(const char *);
__extern int symlink(const char *, const char *);
__extern int symlinkat(int, const char *, const char *);
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 5fd2753265331b..d935a92bcb63bf 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -124,6 +124,7 @@ int mkdir(const char *, mode_t);
<?> int mkdirat(int, const char *, const char *, mode_t);
int rmdir(const char *);
<!alpha,ia64,mips,mips64,sh,sparc,sparc64> int pipe(int *);
+int pipe2(int *, int);
mode_t umask(mode_t);
int chroot(const char *);
int symlink(const char *, const char *);