summaryrefslogtreecommitdiff
path: root/libpthread/nptl/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/init.c')
-rw-r--r--libpthread/nptl/init.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index 5d25ded7d..a6c0ec6af 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -195,8 +195,14 @@ __pthread_initialize_minimal_internal (void)
doing the test once this early is beneficial. */
{
int word = 0;
+#if defined(__UCLIBC_USE_TIME64__) && defined(__NR_futex_time64)
+ word = INTERNAL_SYSCALL (futex_time64, err, 3, &word,
+ FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
+#else
word = INTERNAL_SYSCALL (futex, err, 3, &word,
FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
+#endif
+
if (!INTERNAL_SYSCALL_ERROR_P (word, err))
THREAD_SETMEM (pd, header.private_futex, FUTEX_PRIVATE_FLAG);
}
@@ -215,9 +221,16 @@ __pthread_initialize_minimal_internal (void)
is irrelevant. Given that passing six parameters is difficult
on some architectures we just pass whatever random value the
calling convention calls for to the kernel. It causes no harm. */
+#if defined(__UCLIBC_USE_TIME64__) && defined(__NR_futex_time64)
+ word = INTERNAL_SYSCALL (futex_time64, err, 5, &word,
+ FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
+ | FUTEX_PRIVATE_FLAG, 1, NULL, 0);
+#else
word = INTERNAL_SYSCALL (futex, err, 5, &word,
FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
| FUTEX_PRIVATE_FLAG, 1, NULL, 0);
+#endif
+
assert (INTERNAL_SYSCALL_ERROR_P (word, err));
if (INTERNAL_SYSCALL_ERRNO (word, err) != ENOSYS)
__set_futex_clock_realtime ();
@@ -278,17 +291,17 @@ __pthread_initialize_minimal_internal (void)
struct rlimit limit;
if (getrlimit (RLIMIT_STACK, &limit) != 0
|| limit.rlim_cur == RLIM_INFINITY)
- /* The system limit is not usable. Use an architecture-specific
- default. */
- limit.rlim_cur = ARCH_STACK_DEFAULT_SIZE;
- else if (limit.rlim_cur < PTHREAD_STACK_MIN)
+ /* The system limit is not usable. Use a user-specified or
+ architecture-specific default. */
+ limit.rlim_cur = __PTHREADS_STACK_DEFAULT_SIZE__;
+ if (limit.rlim_cur < PTHREAD_STACK_MIN)
/* The system limit is unusably small.
Use the minimal size acceptable. */
limit.rlim_cur = PTHREAD_STACK_MIN;
- /* Do not exceed architecture specific default */
- if (limit.rlim_cur > ARCH_STACK_DEFAULT_SIZE)
- limit.rlim_cur = ARCH_STACK_DEFAULT_SIZE;
+ /* Do not exceed the user-specified or architecture-specific default */
+ if (limit.rlim_cur > __PTHREADS_STACK_DEFAULT_SIZE__)
+ limit.rlim_cur = __PTHREADS_STACK_DEFAULT_SIZE__;
/* Make sure it meets the minimum size that allocate_stack
(allocatestack.c) will demand, which depends on the page size. */