summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/pipe.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2012-10-10 16:24:43 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-20 13:45:11 +0100
commitdde074b3905cce833e1cdca591174454e046083e (patch)
treea033c3486d1472c33693eda1cd4108f20111e0f3 /libc/sysdeps/linux/common/pipe.c
parent80dc2ed052dc9a52080ed04bd946f3a537492f24 (diff)
pipe: Use pipe2 if arch does not have the pipe syscall
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/pipe.c')
-rw-r--r--libc/sysdeps/linux/common/pipe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/pipe.c b/libc/sysdeps/linux/common/pipe.c
index 8eae27ca4..bd3929781 100644
--- a/libc/sysdeps/linux/common/pipe.c
+++ b/libc/sysdeps/linux/common/pipe.c
@@ -11,5 +11,13 @@
#include <unistd.h>
+#if defined __NR_pipe2 && !defined __NR_pipe
+int pipe(int filedes[2])
+{
+ return pipe2(filedes, 0);
+}
+/* If both are defined then use the pipe syscall */
+#else
_syscall1(int, pipe, int *, filedes)
+#endif
libc_hidden_def(pipe)