alpha, ia64, sh, sparc, sparc64: fix pipe and pipe2 syscalls decoding
Fix pipe syscall decoding on alpha.
Fix pipe2 syscall decoding on ia64, sh, sparc, and sparc64.
* configure.ac (AC_CHECK_FUNCS): Add pipe2.
* defs.h [ALPHA || IA64 || SH || SPARC || SPARC64] (HAVE_GETRVAL2):
Define.
* net.c (do_pipe): Check HAVE_GETRVAL2 instead of architecture macros.
Do not use getrval2 for pipe2 decoding.
Print address if umove call fails.
* syscall.c (getrval2): Check HAVE_GETRVAL2 instead of architecture
macros. Implement for [ALPHA].
* tests/pipe.c: New file.
* tests/pipe.expected: New file.
* tests/pipe.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add pipe.
(TESTS): Add pipe.test.
(EXTRA_DIST): Add pipe.expected.
* tests/.gitignore: Add pipe.
diff --git a/tests/pipe.c b/tests/pipe.c
new file mode 100644
index 0000000..6a5306f
--- /dev/null
+++ b/tests/pipe.c
@@ -0,0 +1,27 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ (void) close(0);
+ (void) close(1);
+ int fds[2];
+ if (pipe(fds) || fds[0] != 0 || fds[1] != 1)
+ return 77;
+
+#ifdef HAVE_PIPE2
+ (void) close(0);
+ (void) close(1);
+ if (pipe2(fds, O_NONBLOCK) || fds[0] != 0 || fds[1] != 1)
+ return 77;
+ return 0;
+#else
+ return 77;
+#endif
+}