#include <linux/futex.h> #include <syscall.h> long get_robust_list(int pid, struct robust_list_head **head_ptr, size_t * long set_robust_list(struct robust_list_head *head, size_t len); |
get_robust_list returns the head of the robust futex list of the thread with TID defined by the pid argument. If pid is 0, the returned head belongs to the current thread.head_ptr is the pointer to the head of the list of robust futexes. The get_robust_listfunction stores the address of the head of the list here. len_ptr is the pointer to the length variable. get_robust_list stores sizeof(**head_ptr) here.
set_robust_list sets the head of the list of robust futexes owned by the current thread to head. len is the size of *head.
The get_robust_list function fails with EPERM if the current process does not have permission to see the robust futex list of the thread with the TID pid, ESRCH if a thread with the TID pid does not exist, or EFAULT if the head of the robust futex list can’t be stored in the space specified by the head argument.
系統呼叫是唯一可用於偵錯目的,不正常操作所需的。
這兩個系統呼叫是不提供給應用程式的功能,他們可以使用 syscall(3)函式被呼叫。