[git commit] pipe: Use pipe2 if arch does not have the pipe syscall

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Feb 20 12:45:11 UTC 2013


commit: http://git.uclibc.org/uClibc/commit/?id=dde074b3905cce833e1cdca591174454e046083e
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/sysdeps/linux/common/pipe.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/pipe.c b/libc/sysdeps/linux/common/pipe.c
index 8eae27c..bd39297 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)


More information about the uClibc-cvs mailing list