VOP_PATHCONF(9)

πŸ’– VOP_PATHCONF πŸ’–

okay bestie, so this is a page from the Kernel Developer's Manual β€” section 9, kernel-adjacent, very much for the devs poking around in the vnode layer πŸ‘‘ β€” and it's called VOP_PATHCONF. Sit down, grab a boba, we're getting into it. πŸ§‹βœ¨

✨ NAME ✨

VOP_PATHCONF β€” return POSIX pathconf information

🌸 SYNOPSIS 🌸

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

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, the arguments are giving:

  • vp β€” the vnode we wanna get info about πŸ‘€
  • name β€” the type of information to return, like the category, the vibe of the question
  • retval β€” the place to return the information, i.e. where the answer gets dropped off 🎁

And the value of name is literally what decides what comes back:

  • _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 β€” returns 1 if appropriate privileges are required for the chown(2) system call, otherwise 0 πŸ”
  • _PC_NO_TRUNC β€” returns 1 if file names longer than KERN_NAME_MAX are truncated βœ‚οΈ

πŸ’… RETURN VALUES πŸ’…

If name is recognized, *retval gets set to the specified value and zero is returned. If it's not recognized? EINVAL. no in-between, that's just how she goes 😌

πŸŽ€ SEE ALSO πŸŽ€

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. iconic of him, honestly 🫢


okay that's the whole thing, you ate that, go forth and pathconf responsibly πŸ’œ

Debian β€’ July 21, 2019 β€” that's the version-and-date sign-off bestie, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from