@@ -30,6 +30,7 @@ SYSCALL_DEF(chdir, ARG_STR);
#ifdef TARGET_NR_chmod
SYSCALL_DEF(chmod, ARG_STR, ARG_MODEFLAG);
#endif
+SYSCALL_DEF(chroot, ARG_STR);
SYSCALL_DEF_ARGS(clone, ARG_CLONEFLAG, ARG_PTR, ARG_PTR, ARG_PTR, ARG_PTR);
SYSCALL_DEF(close, ARG_DEC);
#ifdef TARGET_NR_creat
@@ -1130,18 +1130,6 @@ print_accept(const struct syscallname *name,
}
#endif
-#ifdef TARGET_NR_chroot
-static void
-print_chroot(const struct syscallname *name,
- abi_long arg0, abi_long arg1, abi_long arg2,
- abi_long arg3, abi_long arg4, abi_long arg5)
-{
- print_syscall_prologue(name);
- print_string(arg0, 1);
- print_syscall_epilogue(name);
-}
-#endif
-
#ifdef TARGET_NR_clock_adjtime
static void
print_clock_adjtime(const struct syscallname *name,
@@ -88,6 +88,19 @@ SYSCALL_IMPL(chmod)
}
#endif
+SYSCALL_IMPL(chroot)
+{
+ char *p = lock_user_string(arg1);
+ abi_long ret;
+
+ if (!p) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(chroot(p));
+ unlock_user(p, arg1, 0);
+ return ret;
+}
+
SYSCALL_IMPL(close)
{
int fd = arg1;
@@ -4241,12 +4241,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
void *p;
switch(num) {
- case TARGET_NR_chroot:
- if (!(p = lock_user_string(arg1)))
- return -TARGET_EFAULT;
- ret = get_errno(chroot(p));
- unlock_user(p, arg1, 0);
- return ret;
#ifdef TARGET_NR_getpgrp
case TARGET_NR_getpgrp:
return get_errno(getpgrp());
@@ -58,9 +58,6 @@
#ifdef TARGET_NR_chown32
{ TARGET_NR_chown32, "chown32" , NULL, NULL, NULL },
#endif
-#ifdef TARGET_NR_chroot
-{ TARGET_NR_chroot, "chroot" , NULL, print_chroot, NULL },
-#endif
#ifdef TARGET_NR_clock_adjtime
{ TARGET_NR_clock_adjtime, "clock_adjtime" , NULL, print_clock_adjtime, NULL },
#endif
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/syscall-defs.h | 1 + linux-user/strace.c | 12 ------------ linux-user/syscall-file.inc.c | 13 +++++++++++++ linux-user/syscall.c | 6 ------ linux-user/strace.list | 3 --- 5 files changed, 14 insertions(+), 21 deletions(-) -- 2.17.1