]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Invoke the set_robust_list system call directly in fork
authorFlorian Weimer <fweimer@redhat.com>
Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)
This removes one of the pthread forwarder functions.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
nptl/nptl-init.c
nptl/pthreadP.h
sysdeps/nptl/fork.c
sysdeps/nptl/pthread-functions.h

index 41c566c9bd2903b8b1257a84ffb3c7d38bb7eb6b..8f9d41ac6231d2bdd2724a66b7de027bc963471b 100644 (file)
@@ -59,14 +59,6 @@ int __set_robust_list_avail;
 /* Version of the library, used in libthread_db to detect mismatches.  */
 static const char nptl_version[] __attribute_used__ = VERSION;
 
-
-#ifdef SHARED
-static
-#else
-extern
-#endif
-void __nptl_set_robust (struct pthread *);
-
 #ifdef SHARED
 static const struct pthread_functions pthread_functions =
   {
@@ -91,25 +83,12 @@ static const struct pthread_functions pthread_functions =
     .ptr___pthread_getspecific = __pthread_getspecific,
     .ptr___pthread_setspecific = __pthread_setspecific,
     .ptr__nptl_setxid = __nptl_setxid,
-    .ptr_set_robust = __nptl_set_robust
   };
 # define ptr_pthread_functions &pthread_functions
 #else
 # define ptr_pthread_functions NULL
 #endif
 
-
-#ifdef SHARED
-static
-#endif
-void
-__nptl_set_robust (struct pthread *self)
-{
-  INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head,
-                        sizeof (struct robust_list_head));
-}
-
-
 /* For asynchronous cancellation we use a signal.  This is the handler.  */
 static void
 sigcancel_handler (int sig, siginfo_t *si, void *ctx)
index 5242a2bce6da4724cfc691035ff1ad227b194b0d..7a3906e2de155cd88605e822bbd464424d214fb8 100644 (file)
@@ -692,9 +692,6 @@ libc_hidden_proto (__nptl_deallocate_tsd)
 extern void __nptl_setxid_error (struct xid_command *cmdp, int error)
   attribute_hidden;
 extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden;
-#ifndef SHARED
-extern void __nptl_set_robust (struct pthread *self);
-#endif
 
 extern void __nptl_stacks_freeres (void) attribute_hidden;
 
index ccdda11a7c540ebd2fd42600726160ad52ab886a..f41c40fca00da6e2557455be14dbbd91105a7528 100644 (file)
@@ -104,15 +104,8 @@ __libc_fork (void)
       self->robust_prev = &self->robust_head;
 #endif
       self->robust_head.list = &self->robust_head;
-#ifdef SHARED
-      if (__builtin_expect (__libc_pthread_functions_init, 0))
-       PTHFCT_CALL (ptr_set_robust, (self));
-#else
-      extern __typeof (__nptl_set_robust) __nptl_set_robust
-       __attribute__((weak));
-      if (__builtin_expect (__nptl_set_robust != NULL, 0))
-       __nptl_set_robust (self);
-#endif
+      INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head,
+                            sizeof (struct robust_list_head));
 
       /* Reset the lock state in the multi-threaded case.  */
       if (multiple_threads)
index 2092ecef07be7a2edcc72fb9ce28429e26152821..844838cd49cee324d14a02eebce24ac525e82f10 100644 (file)
@@ -53,7 +53,6 @@ struct pthread_functions
   void *(*ptr___pthread_getspecific) (pthread_key_t);
   int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
   int (*ptr__nptl_setxid) (struct xid_command *);
-  void (*ptr_set_robust) (struct pthread *);
 };
 
 /* Variable in libc.so.  */