From patchwork Sun Jun 10 03:02:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138175 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2614394lji; Sat, 9 Jun 2018 21:15:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxulGKqjyO7J76jWZS0TvDrNuUu3yIWg5sQqTnIOX0kAd8hz8W986SgTsrKYxPV12bd0k+ X-Received: by 2002:ac8:19ca:: with SMTP id s10-v6mr11316397qtk.303.1528604112882; Sat, 09 Jun 2018 21:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528604112; cv=none; d=google.com; s=arc-20160816; b=thSECNosUXmNUkJ5yuCc5kEuTIhau4PhAZMq3MYor/sIgzroHIHKzHzTYyE7GXt7dK Nc+H58r0t7lhZjXiq8VpUB2tA+L45JIVGCTic7840QEevZIYeo0973OlY7LHwFNxaY5r 8ZE4wDWlrc0Dt/JfxZCJXGDlTjQ82wCJpJum38OyVIobSepHDMkHhJ4osrWcrINUJYjF Sg6BAcmE9lGr0uWyQvRLbyW7z6Mclcf423kYfRbyHpkVcT7rsmaWD6wz8IXhZoKQF5oB WDDGswQrNYmQOp/KpdiFUp3ZBkhub3ISwXE8umlvdZUMzyisPfWwZrXzsq3fbPSELPjz kCgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=adMwfCkzxxgDCaSwfwdUiLouzVMAs8jpoMo27JEfzP0=; b=PavrWZAmBj2KSrrDIqmn3lW9J1qnXEwmjL5qFw5hzIjlMkNJbOFds32qakZNaYBO+v ElZVjUWJKmbmAMIYInGAQs4hl/zcAU6uB0tzk8DNWbNmO8fSBIRGJLuT4FTWojD2X3Yl hWmGkwNnfwzX397X5Lqw0moGcvDjS5do6bk+TJXz4Bui+3k8Bbty2HKWsa3knIBwMJ7Q nH/beg1HhdYReYxU7v2fUVx7ukAX2abKWLiDawGZo+13sSOwpQURaJosaylzNF9jq2dz 5nm1U3fnAeWXPfOGTydxG5a5/JgAwtkXbiraeZNzHxHvpkfHaCVcPK5isfoH5YsYwRdg PkVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IJPFZxjw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g49-v6si15216975qvg.7.2018.06.09.21.15.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 21:15:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IJPFZxjw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrl2-0000Zj-Ag for patch@linaro.org; Sun, 10 Jun 2018 00:15:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqg9-0004qP-HV for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqg8-0004u7-MF for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:05 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:45907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqg8-0004tK-Fy for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:06:04 -0400 Received: by mail-pl0-x241.google.com with SMTP id c23-v6so10385837plz.12 for ; Sat, 09 Jun 2018 20:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=adMwfCkzxxgDCaSwfwdUiLouzVMAs8jpoMo27JEfzP0=; b=IJPFZxjw1qsv02A1JS8dTjZzQ0AaaW6fHeraNtP6KmhkSdQBAsg8OJ6PbDVuf/XhaF SrHZabpeAqIDVzkltCg1PNy/GKEfFWWo9jE4jsE8f70g4wiQuEkWmnhHzoNHW5XuBEob QsDFnRCzzqQM4tanUPFlGakP8mP4ynz+itCtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=adMwfCkzxxgDCaSwfwdUiLouzVMAs8jpoMo27JEfzP0=; b=Ae9zTgKB+X2NCY65pZzIY0RxNRwOurvZieWRRirXuF1y7nd+cBXg9VcvoCspvAKOAq UutCfXQrycJygfkoiGv6T3DnvL6SgPO7PI5F55e8fmX1c1Qi74Dfz6y83cslMr+esJ0B 28eJskDnD/FCBIMYvR3OCgunvW+CBGZx2iUtXPe1TINj3eXI4W3I7Ty85KfZ7qloE6tg 2RZZF3+kB8LUOOtSHZpXhpieQYSYvZXkTbiakABj0YjMDuzGXy6dM0y6S01rMlBVrTzb Lb4YFqbpRoChHmzPIpK81usVuOGOhssHiKfZPyYDRlLn4PBgVs8foafcInu1xJFUWh4A OVGA== X-Gm-Message-State: APt69E00JWX4GSs8NhQ7QiM7l70YIUyXc5oJfeldLtJoJ10Av8kLjBtb SecBsZuUdl9YjwBPRSkbp/mGVHfFCPA= X-Received: by 2002:a17:902:e3:: with SMTP id a90-v6mr3930433pla.227.1528599963398; Sat, 09 Jun 2018 20:06:03 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id y17-v6sm31712718pfe.33.2018.06.09.20.06.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:06:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:02:19 -1000 Message-Id: <20180610030220.3777-108-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180610030220.3777-1-richard.henderson@linaro.org> References: <20180610030220.3777-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH v2 107/108] linux-user: Split out setns, unshare X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" All targets define both of these; remove the ifdefs. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d15f994039..7a94a0b0e9 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11820,6 +11820,13 @@ IMPL(setitimer) return ret; } +#ifdef CONFIG_SETNS +IMPL(setns) +{ + return get_errno(setns(arg1, arg2)); +} +#endif + IMPL(setpgid) { return get_errno(setpgid(arg1, arg2)); @@ -12984,6 +12991,13 @@ IMPL(unlinkat) return ret; } +#ifdef CONFIG_SETNS +IMPL(unshare) +{ + return get_errno(unshare(arg1)); +} +#endif + #ifdef TARGET_NR_utime IMPL(utime) { @@ -13200,23 +13214,11 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - CPUState *cpu __attribute__((unused)) = ENV_GET_CPU(cpu_env); - abi_long ret; - switch(num) { -#if defined(TARGET_NR_setns) && defined(CONFIG_SETNS) - case TARGET_NR_setns: - return get_errno(setns(arg1, arg2)); -#endif -#if defined(TARGET_NR_unshare) && defined(CONFIG_SETNS) - case TARGET_NR_unshare: - return get_errno(unshare(arg1)); -#endif default: gemu_log("qemu: Unsupported syscall: %d\n", num); return -TARGET_ENOSYS; } - return ret; } /* The default action for a syscall not listed in syscall_table is to @@ -13770,6 +13772,9 @@ static impl_fn *syscall_table(unsigned num) #endif SYSCALL(sethostname); SYSCALL(setitimer); +#ifdef CONFIG_SETNS + SYSCALL(setns); +#endif SYSCALL(setpgid); SYSCALL(setpriority); SYSCALL(setregid); @@ -13916,6 +13921,9 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(unlink); #endif SYSCALL(unlinkat); +#ifdef CONFIG_SETNS + SYSCALL(unshare); +#endif #ifdef TARGET_NR_utime SYSCALL(utime); #endif