move accept4, dup3, and pipe2 to non-linux-specific locations
authorRich Felker <dalias@aerifal.cx>
Sat, 29 Sep 2012 21:40:42 +0000 (17:40 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 29 Sep 2012 21:40:42 +0000 (17:40 -0400)
these interfaces have been adopted by the Austin Group for inclusion
in the next version of POSIX.

src/linux/accept4.c [deleted file]
src/linux/dup3.c [deleted file]
src/linux/pipe2.c [deleted file]
src/network/accept4.c [new file with mode: 0644]
src/unistd/dup3.c [new file with mode: 0644]
src/unistd/pipe2.c [new file with mode: 0644]

diff --git a/src/linux/accept4.c b/src/linux/accept4.c
deleted file mode 100644 (file)
index 6b5c16c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#define _GNU_SOURCE
-#include <sys/socket.h>
-#include "syscall.h"
-#include "libc.h"
-
-int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
-{
-       return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
-}
diff --git a/src/linux/dup3.c b/src/linux/dup3.c
deleted file mode 100644 (file)
index 18f6fcc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#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/linux/pipe2.c b/src/linux/pipe2.c
deleted file mode 100644 (file)
index 83282bb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#define _GNU_SOURCE
-#include <unistd.h>
-#include "syscall.h"
-
-int pipe2(int fd[2], int flg)
-{
-       return syscall(SYS_pipe2, fd, flg);
-}
diff --git a/src/network/accept4.c b/src/network/accept4.c
new file mode 100644 (file)
index 0000000..6b5c16c
--- /dev/null
@@ -0,0 +1,9 @@
+#define _GNU_SOURCE
+#include <sys/socket.h>
+#include "syscall.h"
+#include "libc.h"
+
+int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
+{
+       return socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
+}
diff --git a/src/unistd/dup3.c b/src/unistd/dup3.c
new file mode 100644 (file)
index 0000000..18f6fcc
--- /dev/null
@@ -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 (file)
index 0000000..83282bb
--- /dev/null
@@ -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);
+}