vfs_setpos(9)
π 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 tomaxsizeβ 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:
vfs_setpos_cookie(9)must_set_pos(9)generic_file_llseek_size(9)generic_llseek_cookie(9)generic_file_llseek(9)fixed_size_llseek(9)no_seek_end_llseek(9)no_seek_end_llseek_size(9)noop_llseek(9)
Mwah π β this page is sourced from ./fs, version/date stamped October 2026, and it's vfs_setpos(9). Periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms