about summary refs log tree commit diff
path: root/sysdeps/nptl/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/nptl/fork.c')
-rw-r--r--sysdeps/nptl/fork.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index ea135f8e18..32ceccef8a 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -135,12 +135,6 @@ __libc_fork (void)
   pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
 #endif
 
-  /* We need to prevent the getpid() code to update the PID field so
-     that, if a signal arrives in the child very early and the signal
-     handler uses getpid(), the value returned is correct.  */
-  pid_t parentpid = THREAD_GETMEM (THREAD_SELF, pid);
-  THREAD_SETMEM (THREAD_SELF, pid, -parentpid);
-
 #ifdef ARCH_FORK
   pid = ARCH_FORK ();
 #else
@@ -159,9 +153,6 @@ __libc_fork (void)
       if (__fork_generation_pointer != NULL)
 	*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
 
-      /* Adjust the PID field for the new process.  */
-      THREAD_SETMEM (self, pid, THREAD_GETMEM (self, tid));
-
 #if HP_TIMING_AVAIL
       /* The CPU clock of the thread and process have to be set to zero.  */
       hp_timing_t now;
@@ -233,9 +224,6 @@ __libc_fork (void)
     {
       assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid);
 
-      /* Restore the PID value.  */
-      THREAD_SETMEM (THREAD_SELF, pid, parentpid);
-
       /* Release acquired locks in the multi-threaded case.  */
       if (multiple_threads)
 	{