diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2017-01-22 10:24:51 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2017-01-28 10:31:19 +0100 |
commit | bddde5860ffb8a78587854cc8e3e914bd69269ca (patch) | |
tree | d37c90a9ca983fb8be614844343ba2941927f88a /libpthread/nptl/sysdeps/unix/sysv/linux/fork.c | |
parent | 30adfbeb8843c28869cc6ee33d7c556721cb241a (diff) |
remove PID caching
Follow GNU C Library from c579f48edba88380635ab98cb612030e3ed8691e
and remove the PID caching. These simplifies the architecture specific
assembly code.
The run of the test suite found no regressions, it even solves
some of the test failures for x86/x86_64/sparc.
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Acked-by: Matthew Fortune <Matthew.Fortune@imgtec.com>
Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux/fork.c')
-rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/fork.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c index af4041031..49806dab9 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c @@ -135,12 +135,6 @@ 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 @@ -158,9 +152,6 @@ fork (void) if (__fork_generation_pointer != NULL) *__fork_generation_pointer += 4; - /* 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; @@ -206,9 +197,6 @@ fork (void) { assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid); - /* Restore the PID value. */ - THREAD_SETMEM (THREAD_SELF, pid, parentpid); - /* We execute this even if the 'fork' call failed. */ __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(_stdio_openlist_add_lock); |