From patchwork Fri Jan 18 21:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156052 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3730008jaa; Fri, 18 Jan 2019 13:35:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7JAGrl69p15zo4KzU/VjWu1iae9F1Axwhf+nIAtg/5GsU4xLX9VfkV9/yYQsR4lUcSbVJR X-Received: by 2002:a1c:96ce:: with SMTP id y197mr17538944wmd.36.1547847328990; Fri, 18 Jan 2019 13:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547847328; cv=none; d=google.com; s=arc-20160816; b=vlNi3K2CvHIvrRbdEuQTQtTV/Nxt8+iYHmFJInqXmfvgh8MMhvFLGpGdLSF77Tswoe zeRjJTk3nBMdZoj1mSC6I5jNsXRR/7W+FQZs3e0gpNJpwTToQwNTyGyciqFa0yFGt70i eVH0u4E16EUVqbyRJHKiw5SPS0+fgZ6KIHF6A7xFsDMUkMXT/NeoV8UL8QoR9y928N5L n0p6/R6YeplOdRoo4L2lwqVL96GfNUHryuN7lSuPpD6gRJTuzKQWWMSU7yxagf53hAR+ LOkBUinxRMZ5NEj69qiH1I92F/H09mzTIaRwZDIs7mjUvjAwIllGWdHkU8PpYOlCSUe0 wMXw== 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=My0NLfLI/aLkwxImF9gfK+QIhgs0UBxlMpBaBuGf6j8=; b=LOK+TRiMylSl1+sLLoQ5SzH56TlF56s0oF7ciU2rDvyT75IMsw2vliVfcp1FN86rSC y8Pzk3Zk79iPDn9tpn0az1i/3PxFGP2+AkXXYDtYrg8KFLIeek4Hg3vrjhux31DsVsuG IQP6SOdMF+c0FyGXUSqvwskzzXkYDva8zh1sKO7SDVsZRhiGwsUVZVAdhM81+HkNF0S8 tjIcMfhkfVjDaxCsNuWzpdkpmbx/zP6Dxz74ffufpfdDLnv2SMgBx74jEHBn7768o+LA KC/finuRBYBqg+yBzL3QOewq7JIxMiU69FsCHj2+enx9zgOGPTCjyuB6DlreMLBQUI62 K+qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=P0p99Kgd; 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 y7si62439099wru.306.2019.01.18.13.35.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 18 Jan 2019 13:35:28 -0800 (PST) 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=P0p99Kgd; 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]:47409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbnT-0007VL-VK for patch@linaro.org; Fri, 18 Jan 2019 16:35:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbju-0004hl-PD for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:31:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkbjt-0003xw-Jl for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:31:46 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:37336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkbjt-0003vo-CZ for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:31:45 -0500 Received: by mail-pg1-x543.google.com with SMTP id c25so6648959pgb.4 for ; Fri, 18 Jan 2019 13:31:45 -0800 (PST) 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=My0NLfLI/aLkwxImF9gfK+QIhgs0UBxlMpBaBuGf6j8=; b=P0p99KgdyhxLd1ivohFkQWFpI7hWSwY6WE4Jmsxg2lj69CPQ/ecYYoEWjFBE03h4UA aebmha5UVzP3CGTCpACZ0YmrbBacoiYBuCk/VUk/dlez7pEUpGS3PtJA3fwigdmcdmwT 2BnBnIgDT8hJrX2B0t6zcjudECk26pNpmdApM= 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=My0NLfLI/aLkwxImF9gfK+QIhgs0UBxlMpBaBuGf6j8=; b=fBhJ5Q8VrD1RfKkX36E6+dHvHgBOCJCcLni4zJDUqdP3syQBijFQiQWgE46iIISFkh yi0ruLm/Hz9dpsfpHk+NdlLb86w7kvqrZAO+eCO+CJy60zhurs53SJEfdb+aGtSLoa8e 7H5J8YLSMoqNWMoxnpg4cfUpNPtY035A/ZXeQTnXliSumwiUA/0Dyua8jN/orzqkPXir eoH5+9yORVf5yWk8l2BfuHIUkFhZ/OeeJgA1ZJ3BYAo9TGxYvdboDz1p8f8zKR+ZfVtq xEjOOa1sOI8RjLSFHbM+nCsgY2LoDll1zYWDIw79nBCntwRTx3fT6cWNgBmXzK5uO3R5 6MOw== X-Gm-Message-State: AJcUukd39+x1cN1Beac4MI2SGcabDBjDcGOtOjvzkeG9XzdwNc/iZsZk cL5iUAADtDrXCihS3DNJGD5SRlEXvOM= X-Received: by 2002:a63:8149:: with SMTP id t70mr19677548pgd.172.1547847103794; Fri, 18 Jan 2019 13:31:43 -0800 (PST) Received: from cloudburst.twiddle.net ([2001:8000:10e0:a000:c673:a6b6:fdef:1933]) by smtp.gmail.com with ESMTPSA id v12sm5833667pgg.41.2019.01.18.13.31.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:31:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:30:40 +1100 Message-Id: <20190118213122.22865-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190118213122.22865-1-richard.henderson@linaro.org> References: <20190118213122.22865-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::543 Subject: [Qemu-devel] [PATCH v6 07/49] linux-user: Split out close 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 | 1 + linux-user/syscall-file.inc.c | 8 ++++++++ linux-user/syscall.c | 4 ---- linux-user/strace.list | 3 --- 4 files changed, 9 insertions(+), 7 deletions(-) -- 2.17.2 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index d1a6c6fa3c..797426ae6f 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -16,6 +16,7 @@ * along with this program; if not, see . */ +SYSCALL_DEF(close, ARG_DEC); #ifdef TARGET_NR_open SYSCALL_DEF(open, ARG_STR, ARG_OPENFLAG, ARG_MODEFLAG); #endif diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c index 841795f8aa..feb83c4e87 100644 --- a/linux-user/syscall-file.inc.c +++ b/linux-user/syscall-file.inc.c @@ -16,6 +16,14 @@ * along with this program; if not, see . */ +SYSCALL_IMPL(close) +{ + int fd = arg1; + + fd_trans_unregister(fd); + return get_errno(close(fd)); +} + /* * Helpers for do_openat, manipulating /proc/self/foo. */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 035f17c0d9..f230fe161e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6771,10 +6771,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, fd_trans_unregister(ret); return ret; #endif - case TARGET_NR_close: - fd_trans_unregister(arg1); - return get_errno(close(arg1)); - case TARGET_NR_brk: return do_brk(arg1); #ifdef TARGET_NR_fork diff --git a/linux-user/strace.list b/linux-user/strace.list index 2f466e5699..71a18123bf 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -97,9 +97,6 @@ #ifdef TARGET_NR_clone { TARGET_NR_clone, "clone" , NULL, print_clone, NULL }, #endif -#ifdef TARGET_NR_close -{ TARGET_NR_close, "close" , "%s(%d)", NULL, NULL }, -#endif #ifdef TARGET_NR_connect { TARGET_NR_connect, "connect" , "%s(%d,%#x,%d)", NULL, NULL }, #endif