get_futex_key (9) - Linux Man Pages
get_futex_key: Get parameters which are the keys for a futex
get_futex_key - Get parameters which are the keys for a futex
__useruaddr, int * fshared, union futex_key *key, int rw);
- virtual address of the futex
- 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED
- address where result is stored.
- mapping needs to be read/write (values: VERIFY_READ, VERIFY_WRITE)
a negative error code or 0
The key words are stored in *key on success.
For shared mappings, it's (page->index, file_inode(vma->vm_file), offset_within_page). For private mappings, it's (uaddr, current->mm). We can usually work out the index without swapping in the page.
Rusty Russell <rusty [at] rustcorp.com.au>