[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 31/49] linux-user: Split out getpid, getppid, get
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v6 31/49] linux-user: Split out getpid, getppid, getxpid |
Date: |
Sat, 19 Jan 2019 08:31:04 +1100 |
Signed-off-by: Richard Henderson <address@hidden>
---
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(-)
diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h
index 3453e7afdf..d163bbf409 100644
--- a/linux-user/syscall-defs.h
+++ b/linux-user/syscall-defs.h
@@ -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
diff --git a/linux-user/syscall-proc.inc.c b/linux-user/syscall-proc.inc.c
index 699370c290..c09c83775c 100644
--- a/linux-user/syscall-proc.inc.c
+++ b/linux-user/syscall-proc.inc.c
@@ -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.
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 09fcec7812..6ea1a67345 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5327,16 +5327,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 */
@@ -5668,10 +5658,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());
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 18c93ccc2d..344a2232d6 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -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
--
2.17.2
- [Qemu-devel] [PATCH v6 21/49] linux-user: Split out creat, (continued)
- [Qemu-devel] [PATCH v6 21/49] linux-user: Split out creat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 26/49] linux-user: Split out chdir, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 22/49] linux-user: Split out link, linkat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 24/49] linux-user: Split out execve, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 28/49] linux-user: Split out mknod, mknodat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 25/49] linux-user: Implement execveat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 23/49] linux-user: Split out unlink, unlinkat, rmdir, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 27/49] linux-user: Split out time, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 29/49] linux-user: Split out chmod, fchmod, fchmodat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 30/49] linux-user: Split out lseek, llseek, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 31/49] linux-user: Split out getpid, getppid, getxpid,
Richard Henderson <=
- [Qemu-devel] [PATCH v6 33/49] linux-user: Split out umount, umount2, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 34/49] linux-user: Split out stime, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 32/49] linux-user: Split out mount, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 35/49] linux-user: Split out alarm, pause, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 36/49] linux-user: Split out utime, utimes, futimesat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 39/49] linux-user: Split out sync, syncfs, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 38/49] linux-user: Split out nice, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 37/49] linux-user: Split out access, faccessat, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 40/49] linux-user: Split out kill, Richard Henderson, 2019/01/18
- [Qemu-devel] [PATCH v6 41/49] linux-user: Split out rename, renameat, renameat2, Richard Henderson, 2019/01/18