vfs_setpos(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

vfs_setpos β€” update the file offset for lseek

Okay so bestie, welcome to vfs_setpos(9) from the Kernel API Manual. This is the helper that updates the file offset for lseek, and it's lowkey iconic. ✨

✨ SYNOPSIS ✨

loff_t vfs_setpos (struct file *file , loff_t offset , loff_t maxsize );

🫢 ARGUMENTS 🫢

  • file β€” file structure in question (the main character, obviously πŸ’…)
  • offset β€” file offset to seek to
  • maxsize β€” maximum file size

🌸 DESCRIPTION 🌸

This is a low-level filesystem helper for updating the file offset to the value specified by offset β€” but only if the given offset is valid and it is not equal to the current file offset. No cap, that's the condition. 🫢

On success, it returns the specified offset. On an invalid offset, it returns -EINVAL. That's the vibe check, and invalid offsets do not pass. πŸ’€βœ¨

It's giving "low-level filesystem helper," so don't expect it to do extra side quests. It does its one job and slays. 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/read_write.c:

Mwah πŸ’‹ β€” this page is sourced from ./fs, version/date stamped October 2026, and it's vfs_setpos(9). Periodt. πŸŽ€

πŸ“¦ where this page comes from