From nobody Sun May 25 20:32:41 2025 X-Original-To: dev-commits-src-all@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 4b59Z12nxSz5wkjb; Sun, 25 May 2025 20:32:41 +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 4b59Z11sJxz3rFH; Sun, 25 May 2025 20:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748205161; 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=oK1/wKsJAZe5QZTxJFiQSOfpmTOnKCrzf4wg7GngVeg=; b=Nl0aHnASWMRiWzU98AA3cpyuVd67669nqjh94TxmLVSM6H35Kp4wXPB6MHX58AIypPEvm3 EhgqhcHd94aP+1X/tEWf2d3E8zfu+gn3NZsH3APkrLK6MyZof9DkN/rcyIfuQitCAD1Xpj 4NcetZICt3m5jLDX76WQZRpXjp0e8ijLWD7hQ/h3qEf3pV3d4IOzN21ww5GtGttK18FNi/ hTgFbiHeYtmm+pf0hQNMSJ1JjF2j5u5D9QGluSiMIzB25cmm75+ubtYWP6V/MyY9g1YmCS WK+Rb4ANhJP5awChmCXDVlyUTfitg+r4DRQawaRbRlcnddCRuTrXvETQj9aFcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748205161; 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=oK1/wKsJAZe5QZTxJFiQSOfpmTOnKCrzf4wg7GngVeg=; b=kxRzlOJA+YcyUhXhzLW4D6oDsApT5OAMe8zEF+VMaFwV20z0jTxeH/4zMwckqtuNAuQ6wv qF5wlgvEMlS6GtzV62PdO6xtomhpQ2zkHgIPr7YdmW+DshH5rq41kT6JLpfFOEJcTfy/ed fwV2fxSi916spv435BTnYHCrwhZ0frTCVgUJhI5OsJg+QXGxRPnizI26YJck+435/ZP7Tf a6IZFQ2gt77z4L+M7Ea3YYrrBpwCrVOIBBYt6Bmhcm1D8F87lUwKpCbgUyEPQ9NvHvUD2P SKSaF+6ZnYSibb7ZK/YCibOJrpQ8hpbeqc64IwRG5c7HKxktxCTI1lmiNL3P5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748205161; a=rsa-sha256; cv=none; b=DSllQ3UkQ1VBjKbEsPXcbvz/7rdXcWZfwfH465l4grphYC4/jYU3DKVTestSUZ5ncBmWo2 e+T/HjTvkrKlNODQn6QQDQhehyizdQUXG/dQRpm1IvIl1XXOHclLXOalHETJ1GZfBQTDQk kp6xafpJbiOWMWdUNRR3VCu3eIqs4+KEbYj/eBI0b2CC/elMhKSUy/kVH98JdlOcPHWVcC GQAkX2La9C6DkvrDM2zKKmpKaZ7E/jQyDP3DXhneIzJAghmEMnEH9FTD9ZAh9kfICamtXB Vl08qLDq+po8RaZz7gdVkRjRkZLEEM2nGZNCDzSH/MnS319WcgJnVUh0WQKR3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4b59Z11RF5zdf3; Sun, 25 May 2025 20:32:41 +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 54PKWfl7011718; Sun, 25 May 2025 20:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54PKWfOC011716; Sun, 25 May 2025 20:32:41 GMT (envelope-from git) Date: Sun, 25 May 2025 20:32:41 GMT Message-Id: <202505252032.54PKWfOC011716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fae33d1d12a5 - main - open.2: add a note about conversion of a file descriptor into O_PATH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: fae33d1d12a51ca2bbdc7f5f189f7a4362fb48f7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fae33d1d12a51ca2bbdc7f5f189f7a4362fb48f7 commit fae33d1d12a51ca2bbdc7f5f189f7a4362fb48f7 Author: Konstantin Belousov AuthorDate: 2025-05-25 16:32:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-05-25 20:32:26 +0000 open.2: add a note about conversion of a file descriptor into O_PATH Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D50511 --- lib/libsys/open.2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index d8540637b690..6200723ed85c 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -464,6 +464,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.