fcntl_setlease(9)
π NAME π
fcntl_setlease β bestie, this is the one that sets a lease on an open file β¨ (yes, like a lil' rental agreement but for your file, no cap)
So this whole page lives in the Kernel API Manual section 9, and the page itself is called fcntl_setlease(9) β that's the vibe check you're working with π«Ά
π SYNOPSIS π
int fcntl_setlease (unsigned int fd , struct file *filp , int arg );
π¦ ARGUMENTS π¦
fdβ the open file descriptor, aka the lil' number that says "this file right here" πfilpβ the file pointer, the actualstruct filehandle to the thing πargβ the type of lease you're trying to obtain, like picking which flavour at the ice cream place π
β¨ DESCRIPTION β¨
Okay so listen π β you call this fcntl to establish a lease on the file. That's the whole mission. Establishing. A lease. Slay π
But wait, bestie, hear me out π¨ β you also need to call F_SETSIG if you want to actually receive a signal when that lease gets broken. Not me forgetting that and then wondering why no signal ever showed up π literally the most important plot point. Set your signal, or you're just standing there with a lease and no notifications. Periodt.
π SEE ALSO π
The kernel file ./fs/locks.c is the main character here, and it's bringing its whole friend group π«Ά β every single one of these is linked and invited:
locks_owner_has_blockers(9)lease_open_conflict(9)locks_delete_block(9)posix_lock_file(9)posix_lock_inode_wait(9)inode_lease_ignore_mask(9)__break_lease(9)lease_get_mtime(9)__fcntl_getlease(9)generic_setlease(9)vfs_setlease(9)fcntl_setdeleg(9)flock_lock_inode_wait(9)locks_lock_inode_wait(9)sys_flock(9)vfs_test_lock(9)locks_translate_pid(9)vfs_lock_file(9)vfs_cancel_lock(9)vfs_inode_has_locks(9)
That's the whole page, bestie, you ate that πβ¨ β this lil' gem comes to you from ./fs, dated October 2026 in the Kernel API Manual, and honestly? Iconic. Go forth and lease responsibly ππ¦
π¦ 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