summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2015-03-23 00:04:27 +0000
committerDmitry V. Levin <ldv@altlinux.org>2015-03-23 03:16:51 +0000
commit78ed3f3558942b7c042aeb84ee0f4a2dccf64791 (patch)
tree02ca48d39fdc42d3c03e6a6df245ce7af79e177c /syscall.c
parentc215569efe58a0045c921219635da02ee8e5451b (diff)
downloadstrace-78ed3f3558942b7c042aeb84ee0f4a2dccf64791.tar.gz
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.
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/syscall.c b/syscall.c
index 67af9fd81..e42b8053a 100644
--- a/syscall.c
+++ b/syscall.c
@@ -779,7 +779,7 @@ static struct user_regs_struct arc_regs;
static long get_regs_error;
-#if defined(SPARC) || defined(SPARC64) || defined(IA64) || defined(SH)
+#ifdef HAVE_GETRVAL2
long
getrval2(struct tcb *tcp)
{
@@ -790,6 +790,9 @@ getrval2(struct tcb *tcp)
# elif defined(SH)
if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0)
return -1;
+# elif defined ALPHA
+ if (upeek(tcp->pid, 20, &val) < 0)
+ return -1;
# elif defined(IA64)
val = ia64_regs.gr[9];
# endif