From nobody Wed May 28 10:11:17 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b6ldd43qqz5xGct; Wed, 28 May 2025 10:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b6ldd2Rsgz3ScG; Wed, 28 May 2025 10:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748427077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NToFSy3VbUDX1W0QhGzT64l43Rwf1FK86Uez8fvmWbs=; b=DhxMfPWw8FvLn3MKscK4GTccNZtd2krovVbPUC4hWFrrOiJM3Lhyyqb4OZxZfSQrYVf01m yWaITv33G4cN0o7t08N1gbamr3j58qBvKJgm0i3A7w0PgkEL71bTXy+WXZCH6Mm153u0n9 9ODUED5xix/5Fdlr4b5tFf9i0TKigPcMWBmn4bzELCWQxlEvEorHMY4bBEsSMZezeiQ/ot LbI+U0b6CN0Xhx/wl7+N3cn/aU1laTdTvf+3NO7b+W9PLFCJX46flPfhVgj9nir0O1tVnl Ciu6jC/SAEgjjGmVpOIY7OMzi4lZYhUb2Uj3KS+N5EiT8JEUhNdV1Ut7NyErQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748427077; a=rsa-sha256; cv=none; b=S6Y0a/GfcBQ6GezXgw5mSlg49tp7xFcUVlrhr2uUPLWYPb3wL24ch1T/4wIoVDvypPymzQ m0MSyxIa/tPx6sW3PxsKBdSf7+8+WfE8rpn0hSVpDmutpM/pEJpZLMXgG2/99P4/WY/QPr dyj3fHVj6DO6LQN24tQN40IubliE4hfY0EQNsu9bexx6hZdtjbDl+FWjQ2NulqEcGTEFar Y+jugZkm5rYb/DqQiWIBz/ztxN/aJ//nROZ+ARPxw2amoQSYi9z/S20N0Fv+Z5um16+dDf ZgeyEP1OU6om2y30VAQP7yO1aWB23VNXRmJIo43f7O467uIUiywuz9wCQiK1lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748427077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NToFSy3VbUDX1W0QhGzT64l43Rwf1FK86Uez8fvmWbs=; b=W5aOOchL0ZcX1g7wUtK1iUiUTkXbD0qJ4mcA06MZWeHA4p2P8odqMmQJ9EHOQ7N+CMugHL N05uE7gWocxLih13Ba6wBorr88eU4/kR6EakiCHXZlpYPU000dddu+m056sfoYxpZ/6yMj 8qzUjFB+kkWUmO75/pMgUXU88IKOSNd9lWb9as0bKVwNuYTIXFtIsxvKp0yxJwNLEqAM0O Z4eRx0t/R585PO1FDhFnX7LQA02EWEX0y98JHxJGzpMdNd0EWib4laYEp/jW6PjP8ULNbT 9ZXluba25vZ3B9Sm3vCoraCjpk6zat33soLwnBry0NYg8VVblyxRhbdeHM2+cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b6ldd1pPfzZGw; Wed, 28 May 2025 10:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54SABHhJ035473; Wed, 28 May 2025 10:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54SABHYx035470; Wed, 28 May 2025 10:11:17 GMT (envelope-from git) Date: Wed, 28 May 2025 10:11:17 GMT Message-Id: <202505281011.54SABHYx035470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5c10e8eae0f0 - stable/14 - open.2: add a note about conversion of a file descriptor into O_PATH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5c10e8eae0f071799744f55bc99ef3b712b698ba Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5c10e8eae0f071799744f55bc99ef3b712b698ba commit 5c10e8eae0f071799744f55bc99ef3b712b698ba Author: Konstantin Belousov AuthorDate: 2025-05-25 16:32:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-05-28 10:10:59 +0000 open.2: add a note about conversion of a file descriptor into O_PATH (cherry picked from commit fae33d1d12a51ca2bbdc7f5f189f7a4362fb48f7) --- lib/libc/sys/open.2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 7a760df7cf2f..b3bce8e77793 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -452,6 +452,13 @@ flag for .Xr fstatat 2 and related syscalls. .Pp +Conversely, a file descriptor +.Dv fd +referencing a filesystem file can be converted to the +.Dv O_PATH +type of descriptor by using the following call +.Dl opath_fd = openat(fd, \[dq]\[dq], O_EMPTY_PATH | O_PATH); +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor.