summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-14 00:08:18 -0500
committerMike Frysinger <vapier@gentoo.org>2012-11-14 00:10:32 -0500
commitdbaa240832c159e395e8b3104ecdb551c8f96b5d (patch)
tree2f9fe386497e3bb6133a669db2bbbe9e6f34dc1c /libc/sysdeps/linux
parent92e25ae0cded0579b1d9ea2f41523338cf81bc18 (diff)
libc/sysdeps: add dup3 syscall wrapper
Some projects (like udev) are starting to use this. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/common/Makefile.in1
-rw-r--r--libc/sysdeps/linux/common/dup3.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index b40bb789e..7a5fb59df 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -23,6 +23,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
bdflush.c \
capget.c \
capset.c \
+ dup3.c \
eventfd.c \
inotify.c \
ioperm.c \
diff --git a/libc/sysdeps/linux/common/dup3.c b/libc/sysdeps/linux/common/dup3.c
new file mode 100644
index 000000000..539c0716c
--- /dev/null
+++ b/libc/sysdeps/linux/common/dup3.c
@@ -0,0 +1,13 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * dup2() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <unistd.h>
+
+_syscall3(int, dup3, int, oldfd, int, newfd, int, flags)