@@ -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
@@ -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;
@@ -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
@@ -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
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- 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(-) -- 2.17.1