VOP_ACCESS(9) check access permissions of a file or Unix domain socket

Other Alias

VOP_ACCESSX

SYNOPSIS

In sys/param.h In sys/vnode.h Ft int Fn VOP_ACCESS struct vnode *vp accmode_t accmode struct ucred *cred struct thread *td Ft int Fn VOP_ACCESSX struct vnode *vp accmode_t accmode struct ucred *cred struct thread *td

DESCRIPTION

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

Its arguments are:

Fa vp
The vnode of the file to check.
Fa accmode
The type of access required.
Fa cred
The user credentials to check.
Fa td
The thread which is checking.

The Fa accmode is a mask which can contain flags described in <sys/vnode.h>, e.g. VREAD VWRITE or VEXEC For Fn VOP_ACCESS , the only flags that may be set in Fa accmode are VEXEC VWRITE VREAD VADMIN and VAPPEND To check for other flags, one has to use Fn VOP_ACCESSX instead.

LOCKS

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

RETURN VALUES

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

ERRORS

Bq Er EPERM
An attempt was made to change an immutable file.
Bq Er EACCES
The permission bits the file mode or the ACL do not permit the requested access.

AUTHORS

This manual page was written by An Doug Rabson .