From 42f0e965c42d7611e7a02718bffb1a8ffba74488 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 23 Jul 2012 16:32:49 -0400 Subject: [PATCH] add pipe2 syscall based on patch by orc and Isaac Dunham, with some details fixed. --- include/unistd.h | 1 + src/linux/pipe2.c | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/linux/pipe2.c diff --git a/include/unistd.h b/include/unistd.h index 9c737f7c..17fe5e7c 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -174,6 +174,7 @@ int setresgid(gid_t, gid_t, gid_t); int getresuid(uid_t *, uid_t *, uid_t *); int getresgid(gid_t *, gid_t *, gid_t *); char *get_current_dir_name(void); +int pipe2(int [2], int); #endif #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) diff --git a/src/linux/pipe2.c b/src/linux/pipe2.c new file mode 100644 index 00000000..83282bb9 --- /dev/null +++ b/src/linux/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); +} -- 2.25.1