get_futex_key(9)
π get_futex_key(9) π
okay bestie, welcome to the Kernel API Manual page for get_futex_key(9) β this one is literally about getting the parameters that are the keys for a futex. no cap, itβs a little kernel-key situation and weβre keeping every detail. π«Άβ¨
πΈ NAME πΈ
get_futex_key β Get parameters which are the keys for a futex
β¨ SYNOPSIS β¨
int get_futex_key (u32 __user *uaddr , unsigned int flags , union
futex_key *key , enum futex_access rw );
π ARGUMENTS π
uaddrβ virtual address of the futexflagsβFLAGS_*keyβ address where result is stored.rwβ mapping needs to be read/write (values:FUTEX_READ,FUTEX_WRITE)
π₯ RETURN π₯
a negative error code or 0
π¦ DESCRIPTION π¦
The key words are stored in key on success.
For shared mappings (when fshared), the key is:
( inode->i_sequence, page offset within mapping, offset_within_page )
[ also see get_inode_sequence_number ]
For private mappings (or when !fshared), the key is:
( current->mm, address, 0 )
This allows (cross process, where applicable) identification of the futex without keeping the page pinned for the duration of the FUTEX_WAIT.
β οΈ lock_page might sleep, the caller should not hold a spinlock. π
π SEE ALSO π
Kernel file ./kernel/futex/core.c β also peep these:
__futex_hash(9)futex_setup_timer(9)fault_in_user_writeable(9)futex_top_waiter(9)wait_for_owner_exiting(9)__futex_unqueue(9)futex_unqueue(9)futex_exit_recursive(9)
okay thatβs the whole page, bestie! source/version ./kernel/futex, date October 2026, and the page is get_futex_key(9). mwah π
πβ¨
π¦ 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