From patchwork Sun May 19 20:37:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164537 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4802981ili; Sun, 19 May 2019 14:14:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7C6A3dwVPVW1SJ5eic78NAO5/q9uwNlifaJ1kHinB9v07G5M//kplBVC20ft2PeE0sUWY X-Received: by 2002:a05:6402:78f:: with SMTP id d15mr19616396edy.189.1558300472741; Sun, 19 May 2019 14:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558300472; cv=none; d=google.com; s=arc-20160816; b=u1ynGDDmkLVYSX1vPkjbaZbZupK2Hk63Enr92xUaNuSCDroF/WN9uyvXCKzHWfwCJE wZqTP13Yl4H2wtXxQZArLlQvWyJprYy1m0hbUC7lwnvAjxUL62uoysaGIkoR+39N03xV Jiq5TUqmiTSwgIHVFCJAymfUBGHkVPfIAWQX6EaMzrJpWuB1G9Tc05cqXab7Y9hF1Rdn Cb7vNI5dzPiHAKm60FS6CFetkyUxZI1O3BOL0qb8jw+dlfRwrLAfrgfNo0pQCKx2+121 Sp3Pqqb6S9lYwJvMUJiBivTtEu5GjMFCu+5H5Xs3lF14K8RHmWUt/7Ho13Tn+nif/Vt0 hz6w== 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; bh=ttWxbzBbz5ihBAO0dy5RNz6XPVqQZ5W6pS6uncyoUTw=; b=yifqPW3X8rXFVUQLfcE6PkwBTPPpmTpZBngH14GCgexrDFNBAK0QGHwhmuS168nucl AHq3VQJpBO8mjuNVRt8tUufCysedomkFYso/20aWXInMTP2k94haDo/2oltEJGd/Y51g xCbUCBtyaey+Ew1OnLFdxBJWNX5IsqCxxpb29jSQYDmPaYke6noSS5UuWDfQ6lKWeScw 7FxzPKUkV7CvSljeV92wpk+4gIpQynXeQHj2cpBiyfJ6pn8PTHfM+oRLwWhcBGwSuddz V1pDy8L53Dx8QiL8w9aMNel39Y5Rytzi2nvJmtgo38PyIPLRF54v//E1Won7UgO0KPB9 gOyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ceaU80lF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id w27si4171996eje.284.2019.05.19.14.14.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 19 May 2019 14:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ceaU80lF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:53634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hST8Z-00013D-If for patch@linaro.org; Sun, 19 May 2019 17:14:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSSZs-0003rB-AF for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSSZr-0004iz-5w for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:40 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:42367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSSZq-0004i4-V6 for qemu-devel@nongnu.org; Sun, 19 May 2019 16:38:39 -0400 Received: by mail-pg1-x544.google.com with SMTP id 145so5730522pgg.9 for ; Sun, 19 May 2019 13:38:38 -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=ttWxbzBbz5ihBAO0dy5RNz6XPVqQZ5W6pS6uncyoUTw=; b=ceaU80lFl0hNLo3mamAAuO33hhZrmGbtyI7ycPbYg50IMB1ddBC4BHTkQ00WvE1pW+ qFdLzn5KItuiHl30u+GRqXYe7xaZhA4aI8yMyLyh1MRP+yTG3KXXqLR6LEBhcRNj+Wza cfL4hD3ql9eSVgmhDPwZMpsHGpN+lv2WTFlUYF4uazb+C+lWTAuWg+tXH6hcSCtKsRSc +DUL44+j1eREW2mmqeOizZFkht7KJs8ND+6MQK3Qa+OYMOhWkKE3ZOdM0GTGd0Km+olw tFJbI6eTrYtiqNNUSsYw8kycgw76MjTMNORCpWkQG8/uvatR9lFGTr08bqaMzmBYdFdp XcGw== 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=ttWxbzBbz5ihBAO0dy5RNz6XPVqQZ5W6pS6uncyoUTw=; b=DRJKQKBQXh5jDF65mjlI3LLX7D25OUD/BMCLwJ4hRvRjwiSimyx1eke2NLIRXFnabB tC11R9A8mhjJixuDh8+7yYFV30PUD9sBZqvnjvj10zkdWnuNL/V2P5o+9H5LPHeGUoDF rlR+BlpvFhMmxWXoTG2c2WaSKNkGHXA23FSTteu9LqVYcK/1nF1djuXDCQqU7oAtlarM Nvz69BAfPlzOFhhV9/GVkFbbZUySVnHoknp8WFwsh0D9TWaVExx0TllAatunvQwgYJON 3TkTAfpc6gKz7j31JjZlbg2ui90DWjfQTxmpM+VrWwncgkOvG36lFNnu4cqoxv2l0nZE smSg== X-Gm-Message-State: APjAAAVBSOJ6lk85Qsoeiu0Zc1Nk/VhY1NiPSbQhbWzSq5MHH79LZlhm Lvrfp4x1EaNLuiVQpTQH7hn+uqA8gxA= X-Received: by 2002:a65:6559:: with SMTP id a25mr47363983pgw.33.1558298317681; Sun, 19 May 2019 13:38:37 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id i7sm11397448pfo.19.2019.05.19.13.38.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 13:38:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 19 May 2019 13:37:07 -0700 Message-Id: <20190519203726.20729-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190519203726.20729-1-richard.henderson@linaro.org> References: <20190519203726.20729-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [PATCH v7 55/74] linux-user: Split out getsid, 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-defs.h | 2 ++ linux-user/syscall-proc.inc.c | 10 ++++++++++ linux-user/syscall.c | 4 ---- linux-user/strace.list | 6 ------ 4 files changed, 12 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 2ade9ec749..cd2c127c41 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -69,6 +69,7 @@ SYSCALL_DEF(getpid); #ifdef TARGET_NR_getppid SYSCALL_DEF(getppid); #endif +SYSCALL_DEF(getsid, ARG_DEC); #ifdef TARGET_NR_getxpid SYSCALL_DEF(getxpid); #endif @@ -193,6 +194,7 @@ SYSCALL_DEF(semctl, ARG_DEC, ARG_DEC, ARG_DEC, ARG_HEX); SYSCALL_DEF(semget, ARG_DEC, ARG_DEC, ARG_HEX); #endif SYSCALL_DEF(setpgid, ARG_DEC, ARG_DEC); +SYSCALL_DEF(setsid); #if !defined(SYSCALL_TABLE) || defined(TARGET_NR_semop) SYSCALL_DEF(semop, ARG_DEC, ARG_PTR, ARG_DEC); #endif diff --git a/linux-user/syscall-proc.inc.c b/linux-user/syscall-proc.inc.c index 39de5b7863..567df54581 100644 --- a/linux-user/syscall-proc.inc.c +++ b/linux-user/syscall-proc.inc.c @@ -464,6 +464,11 @@ SYSCALL_IMPL(getppid) } #endif +SYSCALL_IMPL(getsid) +{ + return get_errno(getsid(arg1)); +} + #ifdef TARGET_NR_getxpid SYSCALL_IMPL(getxpid) { @@ -485,6 +490,11 @@ SYSCALL_IMPL(setpgid) return get_errno(setpgid(arg1, arg2)); } +SYSCALL_IMPL(setsid) +{ + return get_errno(setsid()); +} + SYSCALL_IMPL(times) { abi_ulong target_buf = arg1; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 75989a01bf..0e9f4fd5ae 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4241,8 +4241,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { - case TARGET_NR_setsid: - return get_errno(setsid()); #ifdef TARGET_NR_sigaction case TARGET_NR_sigaction: { @@ -5664,8 +5662,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, /* NOTE: the flock constant seems to be the same for every Linux platform */ return get_errno(safe_flock(arg1, arg2)); - case TARGET_NR_getsid: - return get_errno(getsid(arg1)); #if defined(TARGET_NR_fdatasync) /* Not on alpha (osf_datasync ?) */ case TARGET_NR_fdatasync: return get_errno(fdatasync(arg1)); diff --git a/linux-user/strace.list b/linux-user/strace.list index d283c924a7..bf87a6d4cb 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -292,9 +292,6 @@ #ifdef TARGET_NR_getrusage { TARGET_NR_getrusage, "getrusage" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_getsid -{ TARGET_NR_getsid, "getsid" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_getsockname { TARGET_NR_getsockname, "getsockname" , NULL, NULL, NULL }, #endif @@ -1100,9 +1097,6 @@ #ifdef TARGET_NR_set_robust_list { TARGET_NR_set_robust_list, "set_robust_list" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_setsid -{ TARGET_NR_setsid, "setsid" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_setsockopt { TARGET_NR_setsockopt, "setsockopt" , NULL, NULL, NULL }, #endif