about summary refs log tree commit diff
path: root/nptl/init.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 13:29:44 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 13:29:44 +0000
commit13a4ee0bb4ccb6691729bde67233f5ca66209c7c (patch)
tree72d62fed4d091a1f38c021d9c3eab5e50044e8c4 /nptl/init.c
parent0923a2c896f09795cca4a6d800a336a56b0ee42c (diff)
downloadglibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.tar.gz
glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.tar.xz
glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.zip
[BZ #4745]
	[BZ #4586]
	[BZ #4702]
	[BZ #4525]
	[BZ #4514]
	[BZ #4512]
	Merge selected bugfixes from the trunk.
Diffstat (limited to 'nptl/init.c')
-rw-r--r--nptl/init.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/nptl/init.c b/nptl/init.c
index a1aec6b8f7..4449a9dbc0 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -35,6 +35,27 @@
 #include <lowlevellock.h>
 
 
+#ifndef __NR_set_tid_address
+/* XXX For the time being...  Once we can rely on the kernel headers
+   having the definition remove these lines.  */
+#if defined __s390__
+# define __NR_set_tid_address	252
+#elif defined __ia64__
+# define __NR_set_tid_address	1233
+#elif defined __i386__
+# define __NR_set_tid_address	258
+#elif defined __x86_64__
+# define __NR_set_tid_address	218
+#elif defined __powerpc__
+# define __NR_set_tid_address	232
+#elif defined __sparc__
+# define __NR_set_tid_address	166
+#else
+# error "define __NR_set_tid_address"
+#endif
+#endif
+
+
 /* Size and alignment of static TLS block.  */
 size_t __static_tls_size;
 size_t __static_tls_align_m1;
@@ -216,7 +237,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
 			__xidcmd->id[1], __xidcmd->id[2]);
 
   if (atomic_decrement_val (&__xidcmd->cntr) == 0)
-    lll_private_futex_wake (&__xidcmd->cntr, 1);
+    lll_futex_wake (&__xidcmd->cntr, 1);
 
   /* Reset the SETXID flag.  */
   struct pthread *self = THREAD_SELF;
@@ -225,7 +246,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
 
   /* And release the futex.  */
   self->setxid_futex = 1;
-  lll_private_futex_wake (&self->setxid_futex, 1);
+  lll_futex_wake (&self->setxid_futex, 1);
 }
 
 
@@ -234,9 +255,6 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
 extern void **__libc_dl_error_tsd (void) __attribute__ ((const));
 
 
-/* This can be set by the debugger before initialization is complete.  */
-static bool __nptl_initial_report_events;
-
 void
 __pthread_initialize_minimal_internal (void)
 {
@@ -279,18 +297,6 @@ __pthread_initialize_minimal_internal (void)
 #endif
     set_robust_list_not_avail ();
 
-#ifndef __ASSUME_PRIVATE_FUTEX
-  /* Private futexes are always used (at least internally) so that
-     doing the test once this early is beneficial.  */
-  {
-    int word;
-    word = INTERNAL_SYSCALL (futex, err, 3, &word,
-			    FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1);
-    if (!INTERNAL_SYSCALL_ERROR_P (word, err))
-      THREAD_SETMEM (pd, header.private_futex, FUTEX_PRIVATE_FLAG);
-  }
-#endif
-
   /* Set initial thread's stack block from 0 up to __libc_stack_end.
      It will be bigger than it actually is, but for unwind.c/pt-longjmp.c
      purposes this is good enough.  */
@@ -300,9 +306,6 @@ __pthread_initialize_minimal_internal (void)
   INIT_LIST_HEAD (&__stack_user);
   list_add (&pd->list, &__stack_user);
 
-  /* Before initializing __stack_user, the debugger could not find us and
-     had to set __nptl_initial_report_events.  Propagate its setting.  */
-  THREAD_SETMEM (pd, report_events, __nptl_initial_report_events);
 
   /* Install the cancellation signal handler.  If for some reason we
      cannot install the handler we do not abort.  Maybe we should, but