about summary refs log tree commit diff
path: root/src/unistd
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-09-29 17:40:42 -0400
committerRich Felker <dalias@aerifal.cx>2012-09-29 17:40:42 -0400
commitdc62790deec183697489d5fddea03c82f725e7fd (patch)
tree0a86683bd8a0a558a5789e2ccaa45ae29856bd25 /src/unistd
parent79a5e73e518213d5e77a06cfc0db74ffbf7922c6 (diff)
downloadmusl-dc62790deec183697489d5fddea03c82f725e7fd.tar.gz
musl-dc62790deec183697489d5fddea03c82f725e7fd.tar.xz
musl-dc62790deec183697489d5fddea03c82f725e7fd.zip
move accept4, dup3, and pipe2 to non-linux-specific locations
these interfaces have been adopted by the Austin Group for inclusion
in the next version of POSIX.
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/dup3.c10
-rw-r--r--src/unistd/pipe2.c8
2 files changed, 18 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);
+}
diff --git a/src/unistd/pipe2.c b/src/unistd/pipe2.c
new file mode 100644
index 00000000..83282bb9
--- /dev/null
+++ b/src/unistd/pipe2.c
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include "syscall.h"
+
+int pipe2(int fd[2], int flg)
+{
+	return syscall(SYS_pipe2, fd, flg);
+}