---
name: "VOP_ADVLOCK"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/VOP_ADVLOCK"
---

# VOP\_ADVLOCK(9)

advisory record locking

## NAME

**VOP\_ADVLOCK** – advisory record locking

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/vnode.h\>**

**#include \<sys/fcntl.h\>**

**#include \<sys/lockf.h\>**

*int*\

**VOP\_ADVLOCK**(*struct vnode \*vp*, *caddr\_t id*, *int op*, *struct flock \*fl*, *int flags*);

## DESCRIPTION

The arguments are:

- *vp*

  The vnode being manipulated.

- *id*

  The id token which is changing the lock.

- *op*

  The operation to perform (see [fcntl(2)](/fcntl/2.md)).

- *fl*

  Description of the lock.

- *flags*

  One of more of the following:

  - F\_RDLCK

    Shared or read lock.

  - F\_UNLCK

    Unlock.

  - F\_WRLCK

    Exclusive or write lock.

  - F\_WAIT

    Wait until lock is granted.

  - F\_FLOCK

    Use [flock(2)](/flock/2.md) semantics for lock.

  - F\_POSIX

    Use POSIX semantics for lock.

This entry point manipulates advisory record locks on the file. Most file systems delegate the work for this call to **lf\_advlock**().

## RETURN VALUES

Zero is returned on success, otherwise an error is returned.

## SEE ALSO

[fcntl(2)](/fcntl/2.md), [flock(2)](/flock/2.md), [vnode(9)](/vnode/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
