Browse Source

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>
Markos Chandras 11 years ago
parent
commit
dde074b390
1 changed files with 8 additions and 0 deletions
  1. 8 0
      libc/sysdeps/linux/common/pipe.c

+ 8 - 0
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)