VOP_ACCESSX (9)
Leading comments
Copyright (c) 1996 Doug Rabson All rights reserved. This program is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer i...
NAME
VOP_ACCESS VOP_ACCESSX - check access permissions of a file or Unix domain socketSYNOPSIS
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 *tdDESCRIPTION
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.