logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

VOP_ACCESS, VOP_ACCESSX — check access permissions of a file or Unix domain socket

Authors

       This manual page was written by Doug Rabson.

Debian                                         September 18, 2009                                  VOP_ACCESS(9)

Description

       This entry point checks the access permissions of the file against the given credentials.

       Its arguments are:

       vp       The vnode of the file to check.

       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.

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.

Locks

       The vnode will be locked on entry and should remain locked on return.

Name

       VOP_ACCESS, VOP_ACCESSX — check access permissions of a file or Unix domain socket

Return Values

       If the file is accessible in the specified way, then zero is returned,  otherwise  an  appropriate  error
       code is returned.

See Also

vaccess(9), vaccess_acl_nfs4(9), vaccess_acl_posix1e(9), vnode(9)

Synopsis

#include<sys/param.h>#include<sys/vnode.h>intVOP_ACCESS(structvnode*vp, accmode_taccmode, structucred*cred, structthread*td);

       intVOP_ACCESSX(structvnode*vp, accmode_taccmode, structucred*cred, structthread*td);

See Also