-/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
/* Determine the process ID. It might be negative if the thread is
in the middle of a fork() call. */
pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
- if (__builtin_expect (pid < 0, 0))
+ if (__glibc_unlikely (pid < 0))
pid = -pid;
/* Safety check. It would be possible to call this function for
/* Determine the process ID. It might be negative if the thread is
in the middle of a fork() call. */
pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
- if (__builtin_expect (pid < 0, 0))
+ if (__glibc_unlikely (pid < 0))
pid = -pid;
/* Safety check. It would be possible to call this function for
/* Round the resource limit up to page size. */
limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz;
- __default_stacksize = limit.rlim_cur;
+ lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+ __default_pthread_attr.stacksize = limit.rlim_cur;
+ __default_pthread_attr.guardsize = GLRO (dl_pagesize);
+ lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
#ifdef SHARED
/* Transfer the old value from the dynamic linker's internal location. */