From nobody Fri Nov 7 12:01:06 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547848597111668.7555431904337; Fri, 18 Jan 2019 13:56:37 -0800 (PST) Received: from localhost ([127.0.0.1]:47736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkc7w-00086h-41 for importer@patchew.org; Fri, 18 Jan 2019 16:56:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbln-0006CE-ON for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkbll-0006KO-PM for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:43 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:33674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkblj-0005mP-Nx for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:39 -0500 Received: by mail-pg1-x544.google.com with SMTP id z11so6661606pgu.0 for ; Fri, 18 Jan 2019 13:33:15 -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.33.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:33:14 -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=cKg8c0GdaGBrpr59vF70WkJKA+3W0/Fdq6RBztRFrcQ=; b=jmi5XAv2YXgxL8KDT6flfBMd049avg8BLp4V6eMKGOyZw02EPj4YG/eW9EIL/1HL/O KkTyvaPz0NHs0QLvT2bQNBcSeO9ysw2R/nMfFZCydwcZ1yhSb5kdfANIsaHQrXg7CkSe 2NkrEgbc3lKHNzzcLcT1T0VHZSnOmFZMWvqW0= 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=cKg8c0GdaGBrpr59vF70WkJKA+3W0/Fdq6RBztRFrcQ=; b=c1mBWdlDcAzlaeqJYj7R2zuOYOtXYKrBxmPIuda+ikhSS/JRT6hCscVrqhLh6dJ9ce WlM6/hPL8qtOvjLmcVCtfm+eXv33QxkTpVPpalbTLRhOAa/g9U2sX3SklhQuChu7jvX+ tDsBK8SAQLh+1NBkkU6PuW80WuuILpyQvX/mkng7yXfgrbIA/3MncpPSTsAtDMB7IFmP H3jaUB+vVzXdHjSc3KO1GRvg6cB9FL8ML9DWW/8iJPKo0a3tdiM9Gq8V/QM5Iu2UDEgX qCr4ip9ZtKdE62UBM/JEWJEWftiozqAtAGbs6SAWn3l7WiqilhnHKAg4dYq6mnkT8CUl g/hQ== X-Gm-Message-State: AJcUuke6D6DBTyUqspQHVkFL81wOAPROHdzWi87yxJYDXBYOKoWj6WW9 CjhE9dxeJsnkCMcaU/z4Vf0lAvkyBhU= X-Google-Smtp-Source: ALg8bN5f9JbDb4fpuqBN4wH3uUSKUscJ1rXbnAIdRMJzQddv4meYhhEr0PSFKRg1s0foEuvgBoeL8A== X-Received: by 2002:a63:9a52:: with SMTP id e18mr19379832pgo.14.1547847194678; Fri, 18 Jan 2019 13:33:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:31:19 +1100 Message-Id: <20190118213122.22865-46-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::544 Subject: [Qemu-devel] [PATCH v6 46/49] linux-user: Split out acct 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 | 18 ++++++++++++++++++ linux-user/syscall.c | 11 ----------- linux-user/strace.list | 3 --- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 25d5aaccd1..f8f280f376 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -19,6 +19,7 @@ #ifdef TARGET_NR_access SYSCALL_DEF(access, ARG_STR, ARG_ACCESSFLAG); #endif +SYSCALL_DEF(acct, ARG_STR); #ifdef TARGET_NR_alarm SYSCALL_DEF(alarm, ARG_DEC); #endif diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c index 90aacfacaf..dd0bf877d5 100644 --- a/linux-user/syscall-file.inc.c +++ b/linux-user/syscall-file.inc.c @@ -36,6 +36,24 @@ SYSCALL_IMPL(access) } #endif =20 +SYSCALL_IMPL(acct) +{ + abi_ulong target_path =3D arg1; + abi_long ret; + + if (target_path =3D=3D 0) { + ret =3D get_errno(acct(NULL)); + } else { + char *p =3D lock_user_string(target_path); + if (!p) { + return -TARGET_EFAULT; + } + ret =3D get_errno(acct(path(p))); + unlock_user(p, target_path, 0); + } + return ret; +} + SYSCALL_IMPL(chdir) { abi_ulong target_path =3D arg1; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d0bf339281..33d536262f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5293,17 +5293,6 @@ static abi_long do_syscall1(void *cpu_env, int num, = abi_long arg1, void *p; =20 switch(num) { - case TARGET_NR_acct: - if (arg1 =3D=3D 0) { - ret =3D get_errno(acct(NULL)); - } else { - if (!(p =3D lock_user_string(arg1))) { - return -TARGET_EFAULT; - } - ret =3D get_errno(acct(path(p))); - unlock_user(p, arg1, 0); - } - return ret; case TARGET_NR_ioctl: return do_ioctl(arg1, arg2, arg3); #ifdef TARGET_NR_fcntl diff --git a/linux-user/strace.list b/linux-user/strace.list index 4ea11f162e..9f2f8977b4 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -9,9 +9,6 @@ #ifdef TARGET_NR_accept4 { TARGET_NR_accept4, "accept4" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_acct -{ TARGET_NR_acct, "acct" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_add_key { TARGET_NR_add_key, "add_key" , NULL, NULL, NULL }, #endif --=20 2.17.2