diff mbox

[5/7] alpha-linux-user: Fix getxpid.

Message ID 1272906475-14480-6-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson May 3, 2010, 5:07 p.m. UTC
Put ppid in the second return register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/syscall.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3b0e169..8a6cbaf 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4481,13 +4481,18 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_lseek:
         ret = get_errno(lseek(arg1, arg2, arg3));
         break;
-#ifdef TARGET_NR_getxpid
+#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
+    /* Alpha specific */
     case TARGET_NR_getxpid:
-#else
-    case TARGET_NR_getpid:
+        ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid();
+        ret = get_errno(getpid());
+        break;
 #endif
+#ifdef TARGET_NR_getpid
+    case TARGET_NR_getpid:
         ret = get_errno(getpid());
         break;
+#endif
     case TARGET_NR_mount:
 		{
 			/* need to look at the data field */