From patchwork Fri Jun 1 07:30:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 137480 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp615608lji; Fri, 1 Jun 2018 00:47:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7H123BxoNx2A4KCi2IeWyW6G7w4ZNoxsUQTaPJcFOauOBu6yPv6MwmfkCpW/D4m/zdTc+ X-Received: by 2002:a0c:e80c:: with SMTP id y12-v6mr9609421qvn.10.1527839253064; Fri, 01 Jun 2018 00:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527839253; cv=none; d=google.com; s=arc-20160816; b=LNppoUEcNSPW+CyZoGrxlFuSFORbYnI6rqGdSIf/GthYYS9rI2I3roXA80EuM+7As4 OwW/gc20ITjv4yBT8mJBYXXumPiOAQlQzEd8oYI438XembCiE6O40urK4Jj0+zvlIcfZ Bpw9PHONEuf5Mk69bfH8YcMiycnCEObfMF8aT7K/7RGoeetFA/tKCxxStKLbUWabzRfe BJwGEZIhxlZNVo0NFVG6OOX7OFCr6QN7CK7Uy2hInHegSZkC7FC/het9xsBlU+mofCtO c6JK+AUJw8wYr7prQ5VbLd1Mwj255f3BuDiQ/VsqnLm0wj+zhOTko6qt6BK3ExpD8DKh wH3w== 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=YdvcRFu6fx8Wp+G4YhYTw71+KONQN1xb0dqsPpyOeQM=; b=CKKfLbzwYMwd8KJbq54O6J81/vulKESR4m4BYy4+yMmCmWCkNFE+fvgApcQT155HWG 6n0XHCNfF7aonaz1zHKUanG//htqPaQFxVG3llkmN6kTLdb46rKpVtm/vPvZne9HR90Y uEJQsKIf4Os2KVNK2aQK9ooKRki1G1IfQvXIPjFab2vJdVII2UiXdyCy55TNAufxMlzw iNLw8m+9H7LJvaulKSzO9H7BLvUKHdAeUPzyKGiu51lkYUjZs8sK0PvROEcFZhaRLRTu ME6qgyXY371/qxXE7xJCeZGFRiwtk8tQrDlxTQt1WhrnagFvOvzJ5Ln7sgjH7fXoSpXB 3Lcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eXqcZrk7; 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 v67-v6si569532qkb.138.2018.06.01.00.47.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Jun 2018 00:47:33 -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=eXqcZrk7; 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]:47899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOema-0001Xr-Dz for patch@linaro.org; Fri, 01 Jun 2018 03:47:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOeXC-0005vN-JB for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOeXA-0000pd-1r for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:38 -0400 Received: from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]:36963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOeX9-0000or-Rt for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:35 -0400 Received: by mail-pg0-x236.google.com with SMTP id a13-v6so10873101pgu.4 for ; Fri, 01 Jun 2018 00:31:35 -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=YdvcRFu6fx8Wp+G4YhYTw71+KONQN1xb0dqsPpyOeQM=; b=eXqcZrk7a8kGU+q2K3TIw0V7jGEJB42unGgRzNxkda7VQZGoQJramsHJu3PVqBcPVU CAZf43SJXj4gI2juXY48GYOQbJXvDFlXLfEtd8eXH9npUU+WXHy0WEcshj2Hzn9WPwj3 ScLpTphdPEFVsb494nGCMtYhOrff35b6aclGc= 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=YdvcRFu6fx8Wp+G4YhYTw71+KONQN1xb0dqsPpyOeQM=; b=PGm59tvWFasoTX6mS32Fv4PO+kWo4a9STC5BSH2qlyRRsM5RvMpucVyGc3ZqYE9H/9 76nOnD5uUlnrvm9SJWMfJ9Tzp3fEYLqGpK664Tl8XhFAtin3uPV33aRqsF1oTQNFOljR fFrnp1BIHDj5QnwXuHWwStNxG11Nqaa/wYESLIPIX7HyLEior37PU6ncK/Lv3HMggUls 28iFKaz/9k0B8IBcGOXqpD2rANZ56Pp4BEE3hM86/c8TcInBTYHflc0z6rfIxJ+DU5gk mpGtbwksD8RV9q5ZN5GGag9R9rCia9dbYoys4IQd/3aQipbpAEMkY1nPH0OvT8gLMbBn 6t+w== X-Gm-Message-State: ALKqPwe9Z5IYAPmtiSUeyw/ExsKM5exU86sYyjAClE9DnfNb+9p36v2E pOOxq4qcIqRr6WepnRDnkk2Ib87fX+I= X-Received: by 2002:a65:644f:: with SMTP id s15-v6mr7987775pgv.228.1527838294592; Fri, 01 Jun 2018 00:31:34 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id c4-v6sm4431782pgv.86.2018.06.01.00.31.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Jun 2018 00:31:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 1 Jun 2018 00:30:46 -0700 Message-Id: <20180601073050.8054-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180601073050.8054-1-richard.henderson@linaro.org> References: <20180601073050.8054-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:c05::236 Subject: [Qemu-devel] [PATCH 29/33] 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.0 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4d9b9cad6e..3dfb77ac11 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8182,6 +8182,13 @@ IMPL(futimesat) } #endif +#ifdef TARGET_NR_getpgrp +IMPL(getpgrp) +{ + return get_errno(getpgrp()); +} +#endif + #ifdef TARGET_NR_getpid IMPL(getpid) { @@ -8189,6 +8196,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) { @@ -8721,6 +8735,11 @@ IMPL(setpgid) return get_errno(setpgid(arg1, arg2)); } +IMPL(setsid) +{ + return get_errno(setsid()); +} + #ifdef TARGET_NR_stime IMPL(stime) { @@ -8972,16 +8991,6 @@ IMPL(everything_else) char *fn; 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: { @@ -13020,9 +13029,15 @@ static impl_fn * const syscall_table[] = { #ifdef TARGET_NR_futimesat [TARGET_NR_futimesat] = impl_futimesat, #endif +#ifdef TARGET_NR_getpgrp + [TARGET_NR_getpgrp] = impl_getpgrp, +#endif #ifdef TARGET_NR_getpid [TARGET_NR_getpid] = impl_getpid, #endif +#ifdef TARGET_NR_getppid + [TARGET_NR_getppid] = impl_getppid, +#endif #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) [TARGET_NR_getxpid] = impl_getxpid, #endif @@ -13084,6 +13099,7 @@ static impl_fn * const syscall_table[] = { [TARGET_NR_rmdir] = impl_rmdir, #endif [TARGET_NR_setpgid] = impl_setpgid, + [TARGET_NR_setsid] = impl_setsid, #ifdef TARGET_NR_stime [TARGET_NR_stime] = impl_stime, #endif