From 9af5c906d189d8f4aae902d75567639d2a8f4e22 Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Tue, 12 Aug 2014 15:58:57 +0300 Subject: linux-user: add setns and unshare Add support for the setns and unshare syscalls, trivially passed through to the host. Based on patches by Paul Burton, added configure check. Signed-off-by: Paul Burton Signed-off-by: Riku Voipio --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 11 +++++++++++ 2 files changed, 14 insertions(+) (limited to 'linux-user') diff --git a/linux-user/strace.list b/linux-user/strace.list index 8de972a6ee..aa0cd735cc 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1185,6 +1185,9 @@ #ifdef TARGET_NR_set_mempolicy { TARGET_NR_set_mempolicy, "set_mempolicy" , NULL, NULL, NULL }, #endif +#ifdef TARGET_NR_setns +{ TARGET_NR_setns, "setns" , NULL, NULL, NULL }, +#endif #ifdef TARGET_NR_setpgid { TARGET_NR_setpgid, "setpgid" , NULL, NULL, NULL }, #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f1c182bbae..dae10afcb8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9610,6 +9610,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; #endif +#if defined(TARGET_NR_setns) && defined(CONFIG_SETNS) + case TARGET_NR_setns: + ret = get_errno(setns(arg1, arg2)); + break; +#endif +#if defined(TARGET_NR_unshare) && defined(CONFIG_SETNS) + case TARGET_NR_unshare: + ret = get_errno(unshare(arg1)); + break; +#endif + default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); -- cgit v1.2.1