VOP_ADVLOCK(9)

πŸ‘‘ VOP_ADVLOCK β€” advisory record locking πŸ’…

okay bestie, welcome to the VOP_ADVLOCK(9) page from the Kernel Developer's Manual β€” yes we're in kernel land today, get comfy, it's giving ✨serious business✨ but make it cute.


🌸 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 πŸ’–

so basically this entry point manipulates advisory record locks on the file. no cap. and here's the tea β€” most file systems just delegate the whole thing to lf_advlock() and call it a day. iconic behaviour honestly 🫢

now let's meet the arguments, one by one, like a little friend group:

  • vp β€” the vnode being manipulated. that's the main character right there πŸ‘‘
  • id β€” the id token which is changing the lock. it's the one doing the changing, okay?? let it cook.
  • op β€” the operation to perform (peep fcntl(2) for the deets).
  • fl β€” description of the lock. literally describing the lock. so descriptive.
  • flags β€” one of more of the following (yes, we're listing all of them, no skips, we don't do that here):
    • F_WAIT β€” wait until lock is granted. patience is a virtue babe 🧘
    • F_FLOCK β€” use flock(2) semantics for lock.
    • F_POSIX β€” use POSIX semantics for lock.
    • F_REMOTE β€” lock owner is remote NFS client. long distance relationship vibes πŸ’€
    • F_NOINTR β€” mask signals while waiting for the lock.

✨ RETURN VALUES ✨

zero on success. anything else = error, and we hate that for you 😭. literally zero is the slay, everything else is the flop.


πŸ¦‹ SEE ALSO πŸ¦‹


πŸŽ€ AUTHORS πŸŽ€

This manual page was written by Doug Rabson. thank you Doug, you ate fr fr πŸ’…βœ¨


and that's the whole page bestie, mwah πŸ’‹ this was Debian's drop from May 27, 2019, part of the VOP_ADVLOCK(9) saga β€” go forth and lock responsibly 🫢🌈

πŸ“¦ where this page comes from