mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
Linux: set_robust_list syscall number is always available
Due to the built-in tables, __NR_set_robust_list is always defined (although it may not be available at run time). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -117,10 +117,8 @@ static
|
|||||||
void
|
void
|
||||||
__nptl_set_robust (struct pthread *self)
|
__nptl_set_robust (struct pthread *self)
|
||||||
{
|
{
|
||||||
#ifdef __NR_set_robust_list
|
|
||||||
INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head,
|
INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head,
|
||||||
sizeof (struct robust_list_head));
|
sizeof (struct robust_list_head));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -240,14 +238,12 @@ __pthread_initialize_minimal_internal (void)
|
|||||||
pd->robust_prev = &pd->robust_head;
|
pd->robust_prev = &pd->robust_head;
|
||||||
#endif
|
#endif
|
||||||
pd->robust_head.list = &pd->robust_head;
|
pd->robust_head.list = &pd->robust_head;
|
||||||
#ifdef __NR_set_robust_list
|
|
||||||
pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
|
pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
|
||||||
- offsetof (pthread_mutex_t,
|
- offsetof (pthread_mutex_t,
|
||||||
__data.__list.__next));
|
__data.__list.__next));
|
||||||
int res = INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head,
|
int res = INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head,
|
||||||
sizeof (struct robust_list_head));
|
sizeof (struct robust_list_head));
|
||||||
if (INTERNAL_SYSCALL_ERROR_P (res))
|
if (INTERNAL_SYSCALL_ERROR_P (res))
|
||||||
#endif
|
|
||||||
set_robust_list_not_avail ();
|
set_robust_list_not_avail ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +389,6 @@ START_THREAD_DEFN
|
|||||||
if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2))
|
if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2))
|
||||||
futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE);
|
futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE);
|
||||||
|
|
||||||
#ifdef __NR_set_robust_list
|
|
||||||
#ifndef __ASSUME_SET_ROBUST_LIST
|
#ifndef __ASSUME_SET_ROBUST_LIST
|
||||||
if (__set_robust_list_avail >= 0)
|
if (__set_robust_list_avail >= 0)
|
||||||
#endif
|
#endif
|
||||||
@ -399,7 +398,6 @@ START_THREAD_DEFN
|
|||||||
INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head,
|
INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head,
|
||||||
sizeof (struct robust_list_head));
|
sizeof (struct robust_list_head));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If the parent was running cancellation handlers while creating
|
/* If the parent was running cancellation handlers while creating
|
||||||
the thread the new thread inherited the signal mask. Reset the
|
the thread the new thread inherited the signal mask. Reset the
|
||||||
|
@ -83,7 +83,6 @@ __libc_fork (void)
|
|||||||
if (__fork_generation_pointer != NULL)
|
if (__fork_generation_pointer != NULL)
|
||||||
*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
|
*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
|
||||||
|
|
||||||
#ifdef __NR_set_robust_list
|
|
||||||
/* Initialize the robust mutex list setting in the kernel which has
|
/* Initialize the robust mutex list setting in the kernel which has
|
||||||
been reset during the fork. We do not check for errors because if
|
been reset during the fork. We do not check for errors because if
|
||||||
it fails here, it must have failed at process startup as well and
|
it fails here, it must have failed at process startup as well and
|
||||||
@ -106,7 +105,6 @@ __libc_fork (void)
|
|||||||
__attribute__((weak));
|
__attribute__((weak));
|
||||||
if (__builtin_expect (__nptl_set_robust != NULL, 0))
|
if (__builtin_expect (__nptl_set_robust != NULL, 0))
|
||||||
__nptl_set_robust (self);
|
__nptl_set_robust (self);
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reset the lock state in the multi-threaded case. */
|
/* Reset the lock state in the multi-threaded case. */
|
||||||
|
Reference in New Issue
Block a user