---
name: "VOP_ACCESS"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/VOP_ACCESS"
---

# VOP\_ACCESS(9)

check access permissions of a file or Unix domain socket

## NAME

**VOP\_ACCESS**, **VOP\_ACCESSX** – check access permissions of a file or Unix domain socket

## 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 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.

## 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

- \[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

[vaccess(9)](/vaccess/9.md), [vaccess\_acl\_nfs4(9)](/vaccess_acl_nfs4/9.md), [vaccess\_acl\_posix1e(9)](/vaccess_acl_posix1e/9.md), [vnode(9)](/vnode/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
