diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-11-13 10:42:05 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-12-19 16:11:09 -0300 |
commit | 478f70780f28a270205ddbe8cb6ec29cb41d586e (patch) | |
tree | c46c10ac218ba891188667249f5cb52755e4351c /sysdeps/posix/system.c | |
parent | 6a265e577e8d7c9c950a793139df19b2d050ce5b (diff) | |
download | glibc-478f70780f28a270205ddbe8cb6ec29cb41d586e.tar.gz glibc-478f70780f28a270205ddbe8cb6ec29cb41d586e.tar.xz glibc-478f70780f28a270205ddbe8cb6ec29cb41d586e.zip |
Remove __waitpid_nocancel
It enables and disables cancellation with pthread_setcancelstate before calling the waitpid. It simplifies the waitpid implementation for architectures that do not provide either __NR_waitpid or __NR_wait4. Checked on x86_64-linux-gnu.
Diffstat (limited to 'sysdeps/posix/system.c')
-rw-r--r-- | sysdeps/posix/system.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c index d8c6cb8e1c..6de85bd3e4 100644 --- a/sysdeps/posix/system.c +++ b/sysdeps/posix/system.c @@ -81,7 +81,11 @@ cancel_handler (void *arg) __kill_noerrno (args->pid, SIGKILL); - TEMP_FAILURE_RETRY (__waitpid_nocancel (args->pid, NULL, 0)); + int state; + __libc_ptf_call (__pthread_setcancelstate, + (PTHREAD_CANCEL_DISABLE, &state), 0); + TEMP_FAILURE_RETRY (__waitpid (args->pid, NULL, 0)); + __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0); DO_LOCK (); if (SUB_REF () == 0) |