VOP_ACCESS(9)
πΈ NAME πΈ
okay so welcome to the VOP_ACCESS(9) manual page from the Kernel Developerβs Manual, bestie π β this one covers VOP_ACCESS, VOP_ACCESSX, and their whole thing: checking access permissions of a file or a Unix domain socket. periodt.
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_ACCESS(struct vnode *vp, accmode_t accmode, struct ucred *cred,
struct thread *td);
int
VOP_ACCESSX(struct vnode *vp, accmode_t accmode, struct ucred *cred,
struct thread *td);
π¦ DESCRIPTION π¦
This entry point is literally the permission-check main character: it checks the access permissions of the file against the given credentials. no cap.
Its arguments are giving:
vpβ the vnode of the file to check. the fileβs little kernel-side representative πaccmodeβ the type of access required.credβ the user credentials to check.tdβ the thread which is checking.
The accmode is a mask which can contain flags described in <sys/vnode.h>, e.g. VREAD, VWRITE or VEXEC. For VOP_ACCESS(), the only flags that may be set in accmode are VEXEC, VWRITE, VREAD, VADMIN and VAPPEND. To check for other flags, one has to use VOP_ACCESSX() instead. iykyk π₯
π LOCKS π
The vnode will be locked on entry and should remain locked on return. so likeβ¦ it comes in locked and leaves locked, bestie β donβt be weird about it π«Ά
π RETURN VALUES π
If the file is accessible in the specified way, then zero is returned, otherwise an appropriate error code is returned. slay when itβs zero, sad little error code when itβs not π
π ERRORS π
[EPERM]β An attempt was made to change an immutable file.[EACCES]β The permission bits the file mode or the ACL do not permit the requested access.
π SEE ALSO π
π«Ά AUTHORS π«Ά
This manual page was written by Doug Rabson. iconic behavior, honestly π
This page came from Debian, dated September 18, 2009, and its manual-page tag is VOP_ACCESS(9) πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms