From patchwork Sun Jun 10 03:01:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138110 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2588028lji; Sat, 9 Jun 2018 20:28:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJlRbbcMHjsxDu2Vg7k0uhdaJ+m/2bXSmSDFVGr/z41udxyLSobgmpChYXlonBMP8Y1Gbii X-Received: by 2002:a0c:9805:: with SMTP id c5-v6mr10877239qvd.9.1528601321933; Sat, 09 Jun 2018 20:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528601321; cv=none; d=google.com; s=arc-20160816; b=RaO29QMcRAG3bdEMPeOt7jxSZ7d3BnFUFG62R1nc9awsZuOUNks9D9K+/gBpdJzb7M wy5zYmrfJgRFz6NXAuDePeynYiDBspRu8Vf61H6CiAg0rTNXO+SeuMdg4kLmCtURrikE W64lQrwzk+eXQ9J0d7/yXYqo4SFj9pOO8DaMtppUamSXb5GCbN8PbxeUiM3VAPFtvtN6 Vs1yqH4RWMeaPBWY8F574nyGDNQrwYLkEKXL77oo7TDqsb91jTecCP7WXd2FZE2KnMNn Hs7qMwIdQJMfeNpEgfn6TO0hefXIcd4Nh/p4yaCswYFL9dnn4ix/85wHcbB4z+vx6FZA AhKw== 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=T9juBo2ozVvgENxgpaulCOdTX0L1kHpLdmJiMUlcwRE=; b=Rjdrii/ytu2cmVW1uUNVjuhZoZdoZhCR8l/Qdl7TPj4HhY9tlqfydeAJYSIH6Mjqtn dOO6KGfF3P+kjB/6quFpd3qRS40033ktAgJkO23rpJTMnqKRhNx+Kze0GV2mHsz72Lyn StPT0lhpbTF6CbqqSWlKqnz/Mq8NvHUfwS2YFFzTrP/3FrXEAjFv6+QI+agSj21LcEHG IztTUR1vmOr8xnBkXYNPzAIyASsfkeaIQx1DMCrEJhCWLBd3Ajj5JOM9KobiKdLhW1Wt m4XETaz/khcX7vSPPIDC8WozWp0ZtkKIJbM4hAhE/dTPqbM8hyDGUf8xJ1wUnd4TYE5m aAEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IJQtL4vw; 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 z197-v6si9161068qkz.375.2018.06.09.20.28.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 20:28:41 -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=IJQtL4vw; 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]:42314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRr21-000713-C6 for patch@linaro.org; Sat, 09 Jun 2018 23:28:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqdd-0002KC-Az for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqdc-0003SC-Eg for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:03:29 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:42796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqdc-0003Rr-8g for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:03:28 -0400 Received: by mail-pl0-x243.google.com with SMTP id w17-v6so10389854pll.9 for ; Sat, 09 Jun 2018 20:03:28 -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=T9juBo2ozVvgENxgpaulCOdTX0L1kHpLdmJiMUlcwRE=; b=IJQtL4vwv0E+2PxyeU6OWys5CtAHasRE8qvtoesbWKMT7eCeFslnB+0U2XwB7HMeDn wE0Wejj+w3HlM/p92eIQsDGy+sw7vF7vRsweBV9JQfn3784MsT2eLS20yo4IZiThLAFN r73vxLZWDsdQAZyE12fc2jumBiGJb00gyb2ck= 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=T9juBo2ozVvgENxgpaulCOdTX0L1kHpLdmJiMUlcwRE=; b=aqJeM4F26AWUJ7XlMx9oMsqKCMbNLy/ni1x8gN76YwVKdlc9l/B2SKbY4iGFoF1dZb tbCFt3QPe2hBKVuzSkDZhqRMcW/QQqixEiYlqBvQ/w/OQr+1lrDywNtQw1cp5idT1H2/ yVC5i5MjOKu5aheOqFEOBuB4aHwv4l8wgtxGaB5TwJPuiM6VzzGj9Hha+O25JQKSAbvi 3KcQknoyZlli1LpHZD9KE/ts9luoNLvT4B0lCS4AN1aR/1xnCMK8UjQ+KRTbu1JgYNWw YMM3mvasNGB0UEuhIpCEblDnHcF8NE0dGwby/YuvKfl0+BHEPGqZ2dBgNabwvidgYmEz pShA== X-Gm-Message-State: APt69E2u/MeI1qfHWM2zlh9rNMInCnvfiqxqqSrh95xdTVRHcmc0BNV2 q3T3VxV+cpv9/rC52IaZ5arEyuy9YfM= X-Received: by 2002:a17:902:7248:: with SMTP id c8-v6mr13076098pll.128.1528599807054; Sat, 09 Jun 2018 20:03:27 -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.03.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:03:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:01:00 -1000 Message-Id: <20180610030220.3777-29-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::243 Subject: [Qemu-devel] [PATCH v2 028/108] linux-user: Split out getpgrp, getppid, setsid 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 | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8e13a16e91..d78288258a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8131,6 +8131,13 @@ IMPL(futimesat) } #endif +#ifdef TARGET_NR_getpgrp +IMPL(getpgrp) +{ + return get_errno(getpgrp()); +} +#endif + #ifdef TARGET_NR_getpid IMPL(getpid) { @@ -8138,6 +8145,13 @@ IMPL(getpid) } #endif +#ifdef TARGET_NR_getppid +IMPL(getppid) +{ + return get_errno(getppid()); +} +#endif + #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) IMPL(getxpid) { @@ -8613,6 +8627,11 @@ IMPL(setpgid) return get_errno(setpgid(arg1, arg2)); } +IMPL(setsid) +{ + return get_errno(setsid()); +} + #ifdef TARGET_NR_stime IMPL(stime) { @@ -8854,16 +8873,6 @@ static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_getppid /* not on alpha */ - case TARGET_NR_getppid: - return get_errno(getppid()); -#endif -#ifdef TARGET_NR_getpgrp - case TARGET_NR_getpgrp: - return get_errno(getpgrp()); -#endif - case TARGET_NR_setsid: - return get_errno(setsid()); #ifdef TARGET_NR_sigaction case TARGET_NR_sigaction: { @@ -12673,9 +12682,15 @@ static impl_fn *syscall_table(unsigned num) #ifdef TARGET_NR_futimesat SYSCALL(futimesat); #endif +#ifdef TARGET_NR_getpgrp + SYSCALL(getpgrp); +#endif #ifdef TARGET_NR_getpid SYSCALL(getpid); #endif +#ifdef TARGET_NR_getppid + SYSCALL(getppid); +#endif #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) SYSCALL(getxpid); #endif @@ -12727,6 +12742,7 @@ static impl_fn *syscall_table(unsigned num) SYSCALL(rmdir); #endif SYSCALL(setpgid); + SYSCALL(setsid); #ifdef TARGET_NR_stime SYSCALL(stime); #endif