check access permissions based on vnode
vaccess(enum vtype type,
mode_t file_mode, uid_t uid,
gid_t gid, mode_t acc_mode,
struct ucred *cred);
function checks if the credentials described in cred
are sufficient to perform the operation described by
acc_mode, based on the type,
file_mode, uid, and
gid arguments. These arguments would typically be
based on the vnode being accessed.
file_mode is the current mode of the file
that is having access checked. The uid and
gid arguments are the user id and group id
representing the owner of the file. acc_mode describes
the operation desired. It should be one of
representing read, write, and execute, respectively.
vaccess() will return 0 on success, or a
non-zero error value on failure.
- Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions.
This man page was originally written by Robert Watson for FreeBSD. It was modified to represent the OpenBSD implementation by Peter Werner.