1GET_ROBUST_LIST(2)            Linux System Calls            GET_ROBUST_LIST(2)
2
3
4

NAME

6       get_robust_list, set_robust_list - get/set the list of robust futexes
7

SYNOPSIS

9       #include <linux/futex.h>
10       #include <syscall.h>
11
12       long get_robust_list(int pid, struct robust_list_head **head_ptr,
13                        size_t *len_ptr);
14       long set_robust_list(struct robust_list_head *head, size_t len);
15

DESCRIPTION

17       The  robust  futex implementation needs to maintain per-thread lists of
18       robust futexes which are unlocked when the thread exits.   These  lists
19       are  managed in user space, the kernel is only notified about the loca‐
20       tion of the head of the list.
21
22       get_robust_list returns the head of the robust futex list of the thread
23       with  TID  defined  by the pid argument. If pid is 0, the returned head
24       belongs to the current thread.  head_ptr is the pointer to the head  of
25       the  list  of  robust futexes.  The get_robust_list function stores the
26       address of the head of the list here.  len_ptr is the  pointer  to  the
27       length variable.  get_robust_list stores sizeof(**head_ptr) here.
28
29       set_robust_list  sets  the  head of the list of robust futexes owned by
30       the current thread to head.  len is the size of *head.
31
32

RETURN VALUE

34       The set_robust_list and get_robust_list functions return zero when  the
35       operation is successful, an error code otherwise.
36
37

ERRORS

39       The  set_robust_list  function  fails with EINVAL if the len value does
40       not match the size of structure  struct  robust_list_head  expected  by
41       kernel.
42
43       The  get_robust_list  function  fails with EPERM if the current process
44       does not have permission to see the robust futex  list  of  the  thread
45       with the TID pid, ESRCH if a thread with the TID pid does not exist, or
46       EFAULT if the head of the robust futex list  can't  be  stored  in  the
47       space specified by the head argument.
48
49

APPLICATION USAGE

51       A  thread  can  have only one robust futex list; therefore applications
52       that wish to use this functionality should use robust mutexes  provided
53       by glibc.
54
55       The  system  call  is  only available for debugging purposes and is not
56       needed for normal operations.
57
58       Both system calls are not available to application  programs  as  func‐
59       tions; they can be called using the syscall(3) function.
60
61

SEE ALSO

63       futex(2), pthread_mutexattr_setrobust_np(3)
64
65
66
67Linux                            8 August 2006              GET_ROBUST_LIST(2)
Impressum