From dc62790deec183697489d5fddea03c82f725e7fd Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 29 Sep 2012 17:40:42 -0400 Subject: 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. --- src/unistd/dup3.c | 10 ++++++++++ src/unistd/pipe2.c | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/unistd/dup3.c create mode 100644 src/unistd/pipe2.c (limited to 'src/unistd') 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 +#include +#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 +#include "syscall.h" + +int pipe2(int fd[2], int flg) +{ + return syscall(SYS_pipe2, fd, flg); +} -- cgit v1.2.1