From nobody Fri Nov 7 12:04:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547847436652245.39088502077914; Fri, 18 Jan 2019 13:37:16 -0800 (PST) Received: from localhost ([127.0.0.1]:47456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbp7-0000JI-Tp for importer@patchew.org; Fri, 18 Jan 2019 16:37:09 -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) 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) 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-Google-Smtp-Source: ALg8bN4P3IQArRDb8cSuYwh1HENpd7oXacIM35WQCArLPmRuuJr66Y62U7Zfdq7ubbPBvlGDD6rkWA== X-Received: by 2002:a63:8149:: with SMTP id t70mr19677548pgd.172.1547847103794; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 . */ =20 +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 . */ =20 +SYSCALL_IMPL(close) +{ + int fd =3D 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 --=20 2.17.2