From nobody Sun Feb 8 12:19:41 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1656770360; cv=none; d=zohomail.com; s=zohoarc; b=l8zXx2sQAVN408eRvVDm9CObkOBUpA+Vin/6Ab4hpw2sujMOHzTs1XLa8nITDXXk5DdK56N9my3WYBNVyWo2gOq40gSYQX9SJA5FX9wJYDnONnWxIXJ0gEeRr2dGO6CRB0EazLp8N9FRpmXOdBSh6KY+IBrZUuHu1TRvb4SjPpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656770360; h=Content-Transfer-Encoding:Cc: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=7rP1gEhSKhqMbSa+L+cwEFk3+lhmI1TzozVh4dmnW1U=; b=aHcXEM26IyaWDZej34vWFnUw7GAHlJImD92cqAqBS8bD0gUgixGadQN2HLi6Hs7PzpafK75QXcPzDY3b3fOhctfXCZLFtVckzLUosS6vZaM8zcYSeqVL0HoywPOeJnQTFswvMNQpEV4AgFgRh6ECcpgj2J4mSc2Dz8OyLzzopOg= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656770360485510.4890697312287; Sat, 2 Jul 2022 06:59:20 -0700 (PDT) Received: from localhost ([::1]:56322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7deZ-00019E-Di for importer@patchew.org; Sat, 02 Jul 2022 09:59:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcC-0006pW-Id for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:52 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:36353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dcB-0000bh-1q for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:52 -0400 Received: by mail-io1-xd31.google.com with SMTP id r133so4742060iod.3 for ; Sat, 02 Jul 2022 06:56:50 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7rP1gEhSKhqMbSa+L+cwEFk3+lhmI1TzozVh4dmnW1U=; b=73hzKv9FY3sZZ6jk0oAkJcwESRAfhq3Tp5uf4FzeKkoNrx1QjXv2b13z41++OpRXSp ijFtkpxn4WU9qG5MFic/J4I1GqQqMvn3g/0fNIJtN9Tl90ahTEQGbfvwZtrm0ffOhUuK PyreLByUZMRMQllvt2F4SkUgK+9PqzlIA92JS9TRtlA2vfVoY4yIPNquF1xlPi2A32vA CRNT8jhiUpRbqCnJjr7yVb5PbdmrAWCHCQb0FJnT7zkD74NO9k4nTJG3HpEcQSETRfM6 EeUK7ZyUIpLB5FljZMXtRsb6sG/J3DcqNH4QB3Kjn92SxlsTjMpgMMPyAqZRIveRAEGp WkCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7rP1gEhSKhqMbSa+L+cwEFk3+lhmI1TzozVh4dmnW1U=; b=URWfmxQTEgh+KL1SC9KjFOOGPWanWCSd85WA1quiJ6HYe0kYMyWmFYL+7WhKZNNs5e RZ67VzJGqnTD9gP9zv9CHugW6FiKHZl+oWfLUBCO2iXzFWIPsikfei+KVzpC18R451UY g+RpQEjbaatXmjOJepJyrqs7F/37zjIGJ0qseHg1ZL9oHb58pAkHI5wPFhflSMCy2Xox 0IHAEbMCCUF/n0CjdLDbd+0+itY/2Rb+6eDGtZiyGzTxtiPJnHCiBHD2I+3WT2vCRNEs 5J4PCFsp+QzT4dyf//Jb5+q5sY090I3YzkYlw5FNKUtYhvTDrVjoJ0qPjoyNcEJXOke1 kv1A== X-Gm-Message-State: AJIora8wwtRdU24IWDqObo8/UJ1kR0gn5M57ycDlLVddTxNEe1O7Fj2C mT8+Ab/xYOIHlxVb4dvIK4rGMwc2jJ4DYQ== X-Google-Smtp-Source: AGRyM1uwl8FkHe9mmGLD6Vonfmea2igihqwhFcJNp7yuyxloopVTPnuXR4Q5bBm98FkNr+ijABijxA== X-Received: by 2002:a5e:9515:0:b0:675:454a:54d6 with SMTP id r21-20020a5e9515000000b00675454a54d6mr10270134ioj.5.1656770209844; Sat, 02 Jul 2022 06:56:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 09/11] bsd-user: Implement pathconf, lpathconf and fpathconf Date: Sat, 2 Jul 2022 07:57:04 -0600 Message-Id: <20220702135706.73622-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 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: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @bsdimp-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1656770361353100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 32 ++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 12 ++++++++++++ 2 files changed, 44 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 4b2f6dcc1dc..065f576dfe8 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -894,4 +894,36 @@ static abi_long do_bsd_mkfifoat(abi_long arg1, abi_lon= g arg2, return ret; } =20 +/* pathconf(2) */ +static abi_long do_bsd_pathconf(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret =3D get_errno(pathconf(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* lpathconf(2) */ +static abi_long do_bsd_lpathconf(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret =3D get_errno(lpathconf(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fpathconf(2) */ +static abi_long do_bsd_fpathconf(abi_long arg1, abi_long arg2) +{ + return get_errno(fpathconf(arg1, arg2)); +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index be225195fbd..7de4c40bb16 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -475,6 +475,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num= , abi_long arg1, ret =3D do_bsd_mkfifoat(arg1, arg2, arg3); break; =20 + case TARGET_FREEBSD_NR_pathconf: /* pathconf(2) */ + ret =3D do_bsd_pathconf(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_lpathconf: /* lpathconf(2) */ + ret =3D do_bsd_lpathconf(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fpathconf: /* fpathconf(2) */ + ret =3D do_bsd_fpathconf(arg1, arg2); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret =3D -TARGET_ENOSYS; --=20 2.33.1