[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 45/74] linux-user: Split out acct
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v7 45/74] linux-user: Split out acct |
Date: |
Sun, 19 May 2019 13:36:57 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
linux-user/syscall-defs.h | 1 +
linux-user/syscall-file.inc.c | 18 ++++++++++++++++++
linux-user/syscall.c | 11 -----------
linux-user/strace.list | 3 ---
4 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h
index 25d5aaccd1..f8f280f376 100644
--- a/linux-user/syscall-defs.h
+++ b/linux-user/syscall-defs.h
@@ -19,6 +19,7 @@
#ifdef TARGET_NR_access
SYSCALL_DEF(access, ARG_STR, ARG_ACCESSFLAG);
#endif
+SYSCALL_DEF(acct, ARG_STR);
#ifdef TARGET_NR_alarm
SYSCALL_DEF(alarm, ARG_DEC);
#endif
diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c
index 5bd9eaa002..4080ab250e 100644
--- a/linux-user/syscall-file.inc.c
+++ b/linux-user/syscall-file.inc.c
@@ -36,6 +36,24 @@ SYSCALL_IMPL(access)
}
#endif
+SYSCALL_IMPL(acct)
+{
+ abi_ulong target_path = arg1;
+ abi_long ret;
+
+ if (target_path == 0) {
+ ret = get_errno(acct(NULL));
+ } else {
+ char *p = lock_user_string(target_path);
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(acct(path(p)));
+ unlock_user(p, target_path, 0);
+ }
+ return ret;
+}
+
SYSCALL_IMPL(chdir)
{
abi_ulong target_path = arg1;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cdca0dbe4f..5343486a58 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5346,17 +5346,6 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
void *p;
switch(num) {
- case TARGET_NR_acct:
- if (arg1 == 0) {
- ret = get_errno(acct(NULL));
- } else {
- if (!(p = lock_user_string(arg1))) {
- return -TARGET_EFAULT;
- }
- ret = get_errno(acct(path(p)));
- unlock_user(p, arg1, 0);
- }
- return ret;
case TARGET_NR_ioctl:
return do_ioctl(arg1, arg2, arg3);
#ifdef TARGET_NR_fcntl
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 85e3de87d8..ce5e02975b 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -9,9 +9,6 @@
#ifdef TARGET_NR_accept4
{ TARGET_NR_accept4, "accept4" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_acct
-{ TARGET_NR_acct, "acct" , NULL, NULL, NULL },
-#endif
#ifdef TARGET_NR_add_key
{ TARGET_NR_add_key, "add_key" , NULL, NULL, NULL },
#endif
--
2.17.1
- [Qemu-devel] [PATCH v7 29/74] linux-user: Split out lseek, llseek, (continued)
- [Qemu-devel] [PATCH v7 29/74] linux-user: Split out lseek, llseek, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 31/74] linux-user: Split out mount, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 34/74] linux-user: Split out alarm, pause, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 35/74] linux-user: Split out utime, utimes, futimesat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 36/74] linux-user: Split out access, faccessat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 37/74] linux-user: Split out nice, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 38/74] linux-user: Split out sync, syncfs, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 42/74] linux-user: Split out dup, dup2, dup3, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 40/74] linux-user: Split out rename, renameat, renameat2, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 41/74] linux-user: Split out mkdir, mkdirat, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 45/74] linux-user: Split out acct,
Richard Henderson <=
- [Qemu-devel] [PATCH v7 39/74] linux-user: Split out kill, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 46/74] linux-user: Move syscall_init to the end, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 44/74] linux-user: Split out times, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 43/74] linux-user: Split out pipe, pipe2, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 48/74] linux-user: Fix types in ioctl logging, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 49/74] linux-user: Remove sentinel from ioctl_entries, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 51/74] linux-user: Split out setpgid, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 50/74] linux-user: Split out fcntl, fcntl64, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 53/74] linux-user: Split out chroot, Richard Henderson, 2019/05/19
- [Qemu-devel] [PATCH v7 57/74] linux-user: Split out sgetmask, ssetmask, Richard Henderson, 2019/05/19