From nobody Mon May 20 19:51:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.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=gmx.de ARC-Seal: i=1; a=rsa-sha256; t=1664283596; cv=none; d=zohomail.com; s=zohoarc; b=bc72Posq7+syQbTaTq995hL+BRZkGxa8tZuHqpbYVe1T4MnDjSa9IEqGDMFK5iO4hQO06Ej/NAjS8krmpmK7K89PxA3FIvOAQyRJnZBprvrfvvL/OwspLWEJzh8zFaxz2yoG7mQ/1Bc2LJ+8+ticCeHQgXTcy09az8b1no0uKzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664283596; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KMFoTjLnQ03WzEyW4kiuDnlxIII74bVzEuzFyoZiffA=; b=UgFenvPqz6wiwSJjIc4J8lZ3sG/Dio8REM87LzsdDe0ZSnxsDtxkC37djho/uRPfq4NLMt3jNYakpyCuPmaJVLscD4gAFnhSje4lDaKgs3JsxfMepS9ECFIqltOgrZjnY9s3OQYvcmQQvwARosXOghOWkia3wS+Ccj9ihk91AAs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664283596931421.3963624724013; Tue, 27 Sep 2022 05:59:56 -0700 (PDT) Received: from localhost ([::1]:58370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odABn-0003Xu-2p for importer@patchew.org; Tue, 27 Sep 2022 08:59:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od8hd-0005Ly-5m for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:24:47 -0400 Received: from mout.gmx.net ([212.227.15.19]:50071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od8ha-00014T-K2 for qemu-devel@nongnu.org; Tue, 27 Sep 2022 07:24:40 -0400 Received: from p100 ([92.116.138.255]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MHG8g-1oPxPI0Xi4-00DDGZ; Tue, 27 Sep 2022 13:24:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664277876; bh=o77wLiAl8rcyGvv305VZCD/qEl9Bp6TA36qD0AMC4h8=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=Vf/4QncZQuBonbkF1azf3aktrukyKr6sZQcH6KkEZpYNPMZ6xIfEUSCZkXHwtMuo6 Q3gJ8Dv6nckJSJle2ZrdaxAiUqbzRM8VWKFgJzdFEC+DcHOYA1GQSxjxEpA6ooyA+D dVgsl62GaXAdJ18iVZRxnIXNEUCLMZejx8Kw5D40= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Tue, 27 Sep 2022 13:24:34 +0200 From: Helge Deller To: Laurent Vivier , Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2] linux-user: Add faccessat2() syscall Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:IgxcX9ZtHntSFfOBoc9UAgWatrvTsir5jVS0rCGOmJfmGxEhkmG uYyco9L/B6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CRZq4puRjV I6I6p8pU/3CKtpry5ltkr6GhzqboCh8/rjk+V88NNstgFR+llwNf/hDKll+hcUqTAVaGEcJSG wQliUG2bQ2rdXWs0bVnFS5k+5cKcUMzM1gvUY/0idrVJ+CkSNN9aHZcHbummhtpadC3sGoKDC 3NoNXSgXLINjb7bkQfrId7GuV5O8mK8b8pAaB55eAIKnL3R1+VKAZflHB8OtgiyYl2044201A OzC12E32lu2t67CfFLfPUHuY1Ia5IsMNv2OCRa4yGLRH5JOZmfuSnz44DZKDWK96MWVj7K1Km rYsNo858HY98VSsMDJ8V920qup Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=212.227.15.19; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_MSPIKE_ZBI=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmx.net) X-ZM-MESSAGEID: 1664283599527100001 Content-Type: text/plain; charset="utf-8" Add faccessat2() with strace output. Signed-off-by: Helge Deller --- v2: Resending with minor commit message changes. diff --git a/linux-user/strace.c b/linux-user/strace.c index 7d882526da..307d19f5d0 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1931,7 +1931,7 @@ print_execv(CPUArchState *cpu_env, const struct sysca= llname *name, } #endif -#ifdef TARGET_NR_faccessat +#if defined(TARGET_NR_faccessat) || defined(TARGET_NR_faccessat2) static void print_faccessat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, diff --git a/linux-user/strace.list b/linux-user/strace.list index 72e17b1acf..ef120ddd11 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -177,6 +177,9 @@ #ifdef TARGET_NR_faccessat { TARGET_NR_faccessat, "faccessat" , NULL, print_faccessat, NULL }, #endif +#ifdef TARGET_NR_faccessat2 +{ TARGET_NR_faccessat2, "faccessat2" , NULL, print_faccessat, NULL }, +#endif #ifdef TARGET_NR_fadvise64 { TARGET_NR_fadvise64, "fadvise64" , NULL, NULL, NULL }, #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f409121202..f51c4fbabd 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -399,6 +399,9 @@ _syscall3(int, ioprio_set, int, which, int, who, int, i= oprio) #if defined(TARGET_NR_getrandom) && defined(__NR_getrandom) _syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags) #endif +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2) +_syscall4(int, faccessat2, int, dirfd, char *, pathname, int, mode, int, f= lags) +#endif #if defined(TARGET_NR_kcmp) && defined(__NR_kcmp) _syscall5(int, kcmp, pid_t, pid1, pid_t, pid2, int, type, @@ -9098,6 +9101,15 @@ static abi_long do_syscall1(CPUArchState *cpu_env, i= nt num, abi_long arg1, unlock_user(p, arg2, 0); return ret; #endif +#if defined(TARGET_NR_faccessat2) && defined(__NR_faccessat2) + case TARGET_NR_faccessat2: + if (!(p =3D lock_user_string(arg2))) { + return -TARGET_EFAULT; + } + ret =3D get_errno(faccessat2(arg1, p, arg3, arg4)); + unlock_user(p, arg2, 0); + return ret; +#endif #ifdef TARGET_NR_nice /* not on alpha */ case TARGET_NR_nice: return get_errno(nice(arg1));