vfs_setpos_cookie(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, we're in the Kernel API Manual, and the main character of this page is vfs_setpos_cookie(9). It's giving "update the file offset for lseek and reset cookie" energy, no cap. πŸ¦‹

✨ SYNOPSIS ✨

Signature time, and yes you're gonna copy it exactly β€” types and names are sacred:

loff_t vfs_setpos_cookie (struct file *file , loff_t offset , loff_t
maxsize , u64 *cookie );

πŸŽ€ ARGUMENTS πŸŽ€

  • file β€” the file structure in question. literally the file we're working with.
  • offset β€” the file offset to seek to. seek slay.
  • maxsize β€” maximum file size.
  • cookie β€” the cookie to reset. not the snack kind, but okay. πŸͺ

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: update the file offset to the value specified by offset if the given offset is valid and it is not equal to the current file offset, and reset the specified cookie to indicate that a seek happened. That's the whole assignment, periodt. πŸ’…

Return the specified offset on success, and return -EINVAL on invalid offset. Iconic, simple, done.

🌈 SEE ALSO 🌈

Kernel file ./fs/read_write.c is the home base, iykyk. Also go look at:


And that's the page, bestie. The source/version footer is ./fs, dated October 2026, and the title is vfs_setpos_cookie(9). Stay hydrated and may your offsets always be valid πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from