Expand description
Robust list syscalls: set_robust_list, get_robust_list
Robust lists allow the kernel to clean up held futex-based mutexes when a thread dies, preventing deadlocks.
Linux ABI (robust_list_head in userspace): offset 0: struct robust_list list (next pointer, 8 bytes) offset 8: long futex_offset (offset from list entry to futex int) offset 16: struct robust_list *list_op_pending (pending operation)
Total: 24 bytes on x86_64.
ConstantsΒ§
- FUTEX_
OWNER_ πDIED - Futex value bit: the owner has died.
- ROBUST_
LIST_ πLIMIT - Maximum number of entries to walk in a robust list (Linux uses 4096).
- TID_
MASK π - Mask for the TID portion of a futex value.
FunctionsΒ§
- cleanup_
robust_ list - Walk the robust list for a dying task and mark owned futexes as βowner diedβ.
- mark_
futex_ πowner_ died - Mark a futex as owner-died if the current thread still holds it.
- read_
u32_ πfrom_ user - Read a u32 from userspace memory at the given address.
- sys_
get_ robust_ list - SYS_GET_ROBUST_LIST (611): Get the robust list head for a task.
- sys_
set_ robust_ list - SYS_SET_ROBUST_LIST (610): Register the robust list head for the current task.