@@ -36,6 +36,15 @@ SYSCALL_DEF(fchmodat, ARG_ATDIRFD, ARG_STR, ARG_MODEFLAG);
#ifdef TARGET_NR_fork
SYSCALL_DEF(fork);
#endif
+#ifdef TARGET_NR_getpid
+SYSCALL_DEF(getpid);
+#endif
+#ifdef TARGET_NR_getppid
+SYSCALL_DEF(getppid);
+#endif
+#ifdef TARGET_NR_getxpid
+SYSCALL_DEF(getxpid);
+#endif
#ifdef TARGET_NR_ipc
SYSCALL_DEF_ARGS(ipc, ARG_HEX, ARG_DEC, ARG_DEC, ARG_HEX, ARG_PTR, ARG_HEX);
#endif
@@ -438,6 +438,29 @@ SYSCALL_IMPL(fork)
}
#endif
+#ifdef TARGET_NR_getpid
+SYSCALL_IMPL(getpid)
+{
+ return getpid();
+}
+#endif
+
+#ifdef TARGET_NR_getppid
+SYSCALL_IMPL(getppid)
+{
+ return getppid();
+}
+#endif
+
+#ifdef TARGET_NR_getxpid
+SYSCALL_IMPL(getxpid)
+{
+ /* Alpha specific */
+ cpu_env->ir[IR_A4] = getppid();
+ return getpid();
+}
+#endif
+
/*
* Map host to target signal numbers for the wait family of syscalls.
* Assume all other status bits are the same.
@@ -5380,16 +5380,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
-#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
- /* Alpha specific */
- case TARGET_NR_getxpid:
- ((CPUAlphaState *)cpu_env)->ir[IR_A4] = getppid();
- return get_errno(getpid());
-#endif
-#ifdef TARGET_NR_getpid
- case TARGET_NR_getpid:
- return get_errno(getpid());
-#endif
case TARGET_NR_mount:
{
/* need to look at the data field */
@@ -5721,10 +5711,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
return ret;
}
#endif
-#ifdef TARGET_NR_getppid /* not on alpha */
- case TARGET_NR_getppid:
- return get_errno(getppid());
-#endif
#ifdef TARGET_NR_getpgrp
case TARGET_NR_getpgrp:
return get_errno(getpgrp());
@@ -298,15 +298,9 @@
#ifdef TARGET_NR_getpgrp
{ TARGET_NR_getpgrp, "getpgrp" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_getpid
-{ TARGET_NR_getpid, "getpid" , "%s()", NULL, NULL },
-#endif
#ifdef TARGET_NR_getpmsg
{ TARGET_NR_getpmsg, "getpmsg" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_getppid
-{ TARGET_NR_getppid, "getppid" , "%s()", NULL, NULL },
-#endif
#ifdef TARGET_NR_getpriority
{ TARGET_NR_getpriority, "getpriority", "%s(%#x,%#x)", NULL, NULL },
#endif
@@ -365,9 +359,6 @@
#ifdef TARGET_NR_getxgid
{ TARGET_NR_getxgid, "getxgid" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_getxpid
-{ TARGET_NR_getxpid, "getxpid" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_getxuid
{ TARGET_NR_getxuid, "getxuid" , NULL, NULL, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 9 +++++++++ linux-user/syscall-proc.inc.c | 23 +++++++++++++++++++++++ linux-user/syscall.c | 14 -------------- linux-user/strace.list | 9 --------- 4 files changed, 32 insertions(+), 23 deletions(-) -- 2.17.1