aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-21 15:18:58 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-05-21 15:18:58 -0700
commit5203298c5af47a7aaaa91c4d738463be62fd5ab4 (patch)
treecf1ad668b0a10ef6118099959a4a938bc5205bde
parent83b7c1b245557bfd86ad5e00f64f1120c443d2a8 (diff)
downloadklibc-5203298c5af47a7aaaa91c4d738463be62fd5ab4.tar.gz
[klibc] Add dup3() system call
The dup3() system call allows a file descriptor to be duped with the O_CLOEXEC flag set. 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 3eaeaee5a1aa2..3244e21c34e1c 100644
--- a/usr/include/unistd.h
+++ b/usr/include/unistd.h
@@ -103,6 +103,7 @@ __extern ssize_t pwrite(int, const void *, size_t, off_t);
__extern int dup(int);
__extern int dup2(int, int);
+__extern int dup3(int, int, int);
__extern int fcntl(int, int, ...);
__extern int ioctl(int, int, void *);
__extern int ftruncate(int, off_t);
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 35bcdcf22c389..5fd2753265331 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -165,6 +165,7 @@ int close(int);
<32> int _llseek::__llseek(int, unsigned long, unsigned long, off_t *, int);
int dup(int);
int dup2(int, int);
+int dup3(int, int, int);
<i386> int fcntl64@varadic::fcntl(int, int, unsigned long);
<ppc64> int fcntl(int, int, unsigned long);
<!i386,ppc64> int fcntl64,fcntl::fcntl(int, int, unsigned long);