VOP_ADVLOCK(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VOP_ADVLOCK(9) β€” Kernel Developer's Manual, but make it bestie-core ✨

✨ NAME ✨

VOP_ADVLOCK β€” advisory record locking, and honestly it’s giving kernel-lock main character energy πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

Okay so first you gotta include these, no skipping, bestie:

#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/fcntl.h>
#include <sys/lockf.h>

Then the function signature, literally:

int
VOP_ADVLOCK(struct vnode *vp, caddr_t id, int op, struct flock *fl,
    int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

This entry point manipulates advisory record locks on the file. Most file systems delegate the work for this call to lf_advlock(). That’s the tea β€” simple on the surface, with a whole delegation situation underneath πŸ‘‘

Here’s what the arguments are giving:

  • vp β€” the vnode being manipulated. Main character of this call, honestly.
  • id β€” the id token which is changing the lock. It’s the little name tag on the lock-changing situation.
  • op β€” the operation to perform (see fcntl(2)). Yes, go look at fcntl(2) for the op lore.
  • fl β€” the description of the lock. The lock’s whole look, described.
  • flags β€” one or more of the following, bestie:
    • F_WAIT β€” Wait until lock is granted.
    • F_FLOCK β€” Use flock(2) semantics for lock.
    • F_POSIX β€” Use POSIX semantics for lock.
    • F_REMOTE β€” Lock owner is remote NFS client.
    • F_NOINTR β€” Mask signals while waiting for the lock.

🌈 RETURN VALUES 🌈

Zero is returned on success, otherwise an error is returned. That’s it. Zero = slay, error = not the vibe periodt πŸ’€


🐚 SEE ALSO 🐚


🫢 AUTHORS 🫢

This manual page was written by Doug Rabson. Author icon behavior, we stan 🫢✨

πŸŽ€ Signed, sealed, delivered: Debian, February 10, 2021, VOP_ADVLOCK(9) β€” that’s the manual, bestie. πŸ’…
πŸ“¦ where this page comes from