VOP_PATHCONF(9)

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

πŸ’« VOP_PATHCONF(9) πŸ’«

okay so bestie, welcome to the VOP_PATHCONF page β€” it's a kernel developer's manual entry (section 9, yep, the kernel-functions one) and it's literally all about one thing: getting the POSIX pathconf info for a vnode. it's giving "small function, big responsibility" energy and honestly? we stan. πŸŽ€


✨ SYNOPSIS ✨

first things first, the includes β€” copy them exactly, no ad-libbing:

#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/unistd.h>

int
VOP_PATHCONF(struct vnode *vp, int name, long *retval);

like, the whole vibe is: you hand it a vnode, you tell it what info you want, and it drops the answer into *retval. slay. πŸ’…


🌸 DESCRIPTION 🌸

okay so here are the arguments, one by one, no skipping:

  • vp β€” the vnode you want info about. it's the main character here, lowkey.
  • name β€” the type of information you want back. it's a selector, it's picking the vibe.
  • retval β€” the place where the info gets returned. the drop-off spot. 🫢

so when the function runs, the value of name is what decides what comes back. here's the full menu, iykyk:

  • _PC_LINK_MAX β€” the maximum number of links to a file.
  • _PC_NAME_MAX β€” the maximum number of bytes in a file name.
  • _PC_PATH_MAX β€” the maximum number of bytes in a pathname.
  • _PC_PIPE_BUF β€” the maximum number of bytes which will be written atomically to a pipe.
  • _PC_CHOWN_RESTRICTED β€” return 1 if appropriate privileges are required for the chown(2) system call, otherwise 0.
  • _PC_NO_TRUNC β€” return 1 if file names longer than KERN_NAME_MAX are truncated.

periodt. that's the whole list, we didn't leave a single one out. πŸ’–


πŸ”’ LOCKS πŸ”’

important!! the vnode will be locked on entry and it should remain locked on return. do not come in here unlocking things, bestie, that's not the move. πŸš«πŸ”“


πŸ¦‹ RETURN VALUES πŸ¦‹

so here's how it goes:

  • if name is recognized β†’ *retval gets set to the specified value and zero is returned ✨
  • otherwise β†’ EINVAL is returned 😭

that's it, that's the whole contract. no cap.


πŸ‘‘ SEE ALSO πŸ‘‘

go read those if you want the bigger picture, bestie. 🧚


πŸ’œ AUTHORS πŸ’œ

this manual page was written by Doug Rabson. giving credit where credit is due, love that for him. 🌈


and that's a wrap!! this page came from the Debian crew, dated December 31, 2020 β€” so like, it's a little vintage but it's still iconic. new year's eve manpage, actually kind of a serve. πŸ“β­πŸ’€

πŸ“¦ where this page comes from