From patchwork Sun Jun 10 03:01:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138163 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2609153lji; Sat, 9 Jun 2018 21:06:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJoOzuyvsiYM+mxhkxmnGMcFD01BCVppcKVW/NSdJr83MNe0s6gwgLJe4b47IpIxfm+391U X-Received: by 2002:aed:24fb:: with SMTP id u56-v6mr6092841qtc.203.1528603573747; Sat, 09 Jun 2018 21:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528603573; cv=none; d=google.com; s=arc-20160816; b=EdEUC56279p6cs9GKkTxc7D6PW5G/jb+Ai0XbifV/SNQVYEOYSOyWNR9vQNGoTzu8/ 7aexbVLvVBsci//2x095jSIcLTvjignY0MpevI+gppihaBRb1ZF/msWk4UeGFE+zJmVz mUuOIVBhWh4tPY9Z2gfg2mzqFk0lTr5GQuQQ+fkV3Rc5ankN4zKzHSLMusDWzw//y7Gl VRprztJbaFUMi+Km1/eicsSBi73NxDPjSpMPEVEemEu0Ak8F3sdDQt9HoRibJjq66JfY sEptuuQcsBbgIoC7QNNC6CQRhyHh52Qv0S3SZ0mWiYM+wU2glu1l1xaFSXmqcX7NTCMZ 7XVg== 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=KLOF75MuxIiciS1cvvVtBEg4Z9aeDdENZ2YjGYTbsss=; b=mU42lKc3x2tZ8Aok5S5NtQ3tTQgf25UN2wSo7n+2aXK81ekMHyno4aWBLkLwwel0vK Ds8qWpqhHcbA7eMezU9r7209JTxgGfInX9b8r9HxgrY+qTfsSrmymQyjX1QEbvYUD24S nCNylVOm3Xn8r9loK2bGBmwhN7T+8/ixVonbxfF/P/1xz45p7VzOMOobEeP1N38OhHfr MNZ6FibVFYPjMgfXPWGOew4kEhqfHZLu3v3oNhvIuU//ic4yvmhBjtUimIfR5HfeRvC7 b5q5+I4hTfsq97bWUupyqUxBbaxJ9YJAYQBUpnAuUlr5SHJqxSt1w0+QMxEqVvbNol62 BA/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GNvnHQTm; 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 e35-v6si4568854qvd.129.2018.06.09.21.06.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 21:06:13 -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=GNvnHQTm; 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]:42531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRrcL-0000yd-2B for patch@linaro.org; Sun, 10 Jun 2018 00:06:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqfL-0003xl-2V for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqfJ-0004M1-TW for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:15 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:45906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqfJ-0004Lu-NQ for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:05:13 -0400 Received: by mail-pl0-x241.google.com with SMTP id c23-v6so10385320plz.12 for ; Sat, 09 Jun 2018 20:05:13 -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=KLOF75MuxIiciS1cvvVtBEg4Z9aeDdENZ2YjGYTbsss=; b=GNvnHQTm4MyOEKnKrTT7Rac3MLqkwlkJuzOMjQHab2bqMxDEbVH+tv82MYYimrrRTg JQ06qGO+ODAiGRfQF6otXKXMn9RqoR1mku49Jg2FRQDJkgyqnMXlhKtYL1YVGXKWk0+T PrW95Hc/npHcZR6BkrazPPWPZyhLEDIajp1BE= 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=KLOF75MuxIiciS1cvvVtBEg4Z9aeDdENZ2YjGYTbsss=; b=tAWASyG+HywWcgfnp2gwQx6jMqHB414YF7YlnF18tz+VThnsa5zkckQDIaquNJALqb OrUpLXr+ZLL6NnRaCkblAvKngRlujCv9+ydBTmLD6fDHpA4iOzRzYx7WYrF+7ccgdaik BpovjHkb7yiD8FMqxzghyCESCA0EKWtj3WrkjvD1I8eY8wgF+rLGEQxfj8Fz9SZoLlQt RhI+6Q0qrOY9vFqXsd4U61sJjdbMCSjJAPgg0O74BSkUFPCdgHcLdaPMiZvfoqIbUBcC Y2anHgG5tI8CtP4stlNB1b1ghY/cAljc42W+4yHPR+Ow2/MJ0FMm4S/YHwMAaFDMShOO RNCw== X-Gm-Message-State: APt69E2BOGoIaVfU8v2XD05bNr47+8sgi0qJ0q+KMiqS6knB2dUR4a/g VFn8S5+13dfm2ZaS9zbNAvJUdR0CfiE= X-Received: by 2002:a17:902:1029:: with SMTP id b38-v6mr12793763pla.277.1528599912551; Sat, 09 Jun 2018 20:05:12 -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.05.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:05:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:01:51 -1000 Message-Id: <20180610030220.3777-80-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 079/108] linux-user: Split out getegid32, geteuid32, getgid32, setregid32, setreuid32 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" Signed-off-by: Richard Henderson --- linux-user/syscall.c | 70 +++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 20 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ae591a6523..c8bd13092e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8482,6 +8482,13 @@ IMPL(getegid) } #endif +#ifdef TARGET_NR_getegid32 +IMPL(getegid32) +{ + return get_errno(getegid()); +} +#endif + #ifdef TARGET_NR_geteuid IMPL(geteuid) { @@ -8489,6 +8496,13 @@ IMPL(geteuid) } #endif +#ifdef TARGET_NR_geteuid32 +IMPL(geteuid32) +{ + return get_errno(geteuid()); +} +#endif + #ifdef TARGET_NR_getgid IMPL(getgid) { @@ -8496,6 +8510,13 @@ IMPL(getgid) } #endif +#ifdef TARGET_NR_getgid32 +IMPL(getgid32) +{ + return get_errno(getgid()); +} +#endif + IMPL(getgroups) { int gidsetsize = arg1; @@ -10812,6 +10833,13 @@ IMPL(setregid) return get_errno(setregid(low2highgid(arg1), low2highgid(arg2))); } +#ifdef TARGET_NR_setregid32 +IMPL(setregid32) +{ + return get_errno(setregid(arg1, arg2)); +} +#endif + #ifdef TARGET_NR_setresgid IMPL(setresgid) { @@ -10833,6 +10861,13 @@ IMPL(setreuid) return get_errno(setreuid(low2highuid(arg1), low2highuid(arg2))); } +#ifdef TARGET_NR_setreuid32 +IMPL(setreuid32) +{ + return get_errno(setreuid(arg1, arg2)); +} +#endif + IMPL(setrlimit) { int resource = target_to_host_resource(arg1); @@ -11805,26 +11840,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_getgid32 - case TARGET_NR_getgid32: - return get_errno(getgid()); -#endif -#ifdef TARGET_NR_geteuid32 - case TARGET_NR_geteuid32: - return get_errno(geteuid()); -#endif -#ifdef TARGET_NR_getegid32 - case TARGET_NR_getegid32: - return get_errno(getegid()); -#endif -#ifdef TARGET_NR_setreuid32 - case TARGET_NR_setreuid32: - return get_errno(setreuid(arg1, arg2)); -#endif -#ifdef TARGET_NR_setregid32 - case TARGET_NR_setregid32: - return get_errno(setregid(arg1, arg2)); -#endif #ifdef TARGET_NR_getgroups32 case TARGET_NR_getgroups32: { @@ -13168,11 +13183,20 @@ static impl_fn *syscall_table(unsigned num) #ifdef TARGET_NR_getegid SYSCALL(getegid); #endif +#ifdef TARGET_NR_getegid32 + SYSCALL(getegid32); +#endif #ifdef TARGET_NR_geteuid SYSCALL(geteuid); #endif +#ifdef TARGET_NR_geteuid32 + SYSCALL(geteuid32); +#endif #ifdef TARGET_NR_getgid SYSCALL(getgid); +#endif +#ifdef TARGET_NR_getgid32 + SYSCALL(getgid32); #endif SYSCALL(getgroups); SYSCALL(getitimer); @@ -13447,10 +13471,16 @@ static impl_fn *syscall_table(unsigned num) #ifdef TARGET_NR_setresgid SYSCALL(setresgid); #endif +#ifdef TARGET_NR_setregid32 + SYSCALL(setregid32); +#endif #ifdef TARGET_NR_setresuid SYSCALL(setresuid); #endif SYSCALL(setreuid); +#ifdef TARGET_NR_setreuid32 + SYSCALL(setreuid32); +#endif SYSCALL(setrlimit); #ifdef TARGET_NR_setsockopt SYSCALL(setsockopt);