summaryrefslogtreecommitdiff
path: root/src/unistd/dup3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/dup3.c')
-rw-r--r--src/unistd/dup3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unistd/dup3.c b/src/unistd/dup3.c
new file mode 100644
index 00000000..18f6fcce
--- /dev/null
+++ b/src/unistd/dup3.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <errno.h>
+#include "syscall.h"
+
+int dup3(int old, int new, int flags) {
+ int r;
+ while ((r=__syscall(SYS_dup3, old, new, flags))==-EBUSY);
+ return __syscall_ret(r);
+}