alpha-linux-user: Fix getxpid.
authorRichard Henderson <rth@twiddle.net>
Mon, 3 May 2010 17:07:53 +0000 (10:07 -0700)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 21 May 2010 16:22:21 +0000 (16:22 +0000)
Put ppid in the second return register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
linux-user/syscall.c

index 1a5e38184b484b5802febc9d18e60d35e57ffd63..e9e61c82cdb68d2e96ab8aa4df26c5a4c98b0544 100644 (file)
@@ -4497,13 +4497,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 */