Skip to content

Commit

Permalink
open.2: update description for O_PATH
Browse files Browse the repository at this point in the history
- Add fstatfs(), fchdir(), fchroot(), extattr_*_fd(), cap_*_get(),
  cap_*_limit() to the list of syscalls that can take an O_PATH fd.
- Remove readlinkat() from the list, since it is already discussed
  in the first few lines of the paragraph.  It was originally added
  to the list when readlinkat() adds support for non-dir fd with
  an empty relative path (as if with AT_EMPTY_PATH), however,
  such use case is also discussed in the next paragraph.
- Add funlinkat() to the list, since it accepts an extra fd
  (of the file to be unlinked), which is worth extra mentioning.
- Fix a syntax issue which causes a bogus space to be rendered
  before a closing parentheses.

Signed-off-by: CismonX <[email protected]>
  • Loading branch information
CismonX committed Jan 3, 2025
1 parent 526bd07 commit 4948e34
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/libsys/open.2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd August 25, 2024
.Dd January 3, 2025
.Dt OPEN 2
.Os
.Sh NAME
Expand Down Expand Up @@ -330,13 +330,18 @@ and others.
The other functionality of the returned file descriptor is limited to
the descriptor-level operations.
It can be used for
.Bl -tag -width readlinkat(2) -offset indent -compact
.Bl -tag -width funlinkat(2) -offset indent -compact
.It Xr fcntl 2
but advisory locking is not allowed
.It Xr dup 2
.It Xr close 2
.It Xr fstat 2
.It Xr fstatfs 2
.It Xr fchdir 2
.It Xr fchroot 2
.It Xr fexecve 2
.It Xr funlinkat 2
can be passed as the third argument
.It Dv SCM_RIGHTS
can be passed over a
.Xr unix 4
Expand All @@ -346,14 +351,21 @@ message
.It Xr kqueue 2
using for
.Dv EVFILT_VNODE
.It Xr readlinkat 2
.It Xr __acl_get_fd 2 , Xr __acl_aclcheck_fd 2
.It Xr extattr 2
.It Xr capsicum 4
can be passed to
.Fn cap_*_limit
and
.Fn cap_*_get
system calls (such as
.Xr cap_rights_limit 2 ) .
.El
But operations like
.Xr read 2 ,
.Xr ftruncate 2 ,
and any other that operate on file and not on file descriptor (except
.Xr fstat 2 ),
.Xr fstat 2 ) ,
are not allowed.
.Pp
A file descriptor created with the
Expand Down

0 comments on commit 4948e34

Please sign in to comment.