1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

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.
This commit is contained in:
Adhemerval Zanella
2019-11-13 10:42:05 -03:00
parent 6a265e577e
commit 478f70780f
6 changed files with 11 additions and 43 deletions

View File

@ -281,7 +281,11 @@ _IO_new_proc_close (FILE *fp)
described in POSIX.2, such implementations are not conforming." */
do
{
wait_pid = __waitpid_nocancel (((_IO_proc_file *) fp)->pid, &wstatus, 0);
int state;
__libc_ptf_call (__pthread_setcancelstate,
(PTHREAD_CANCEL_DISABLE, &state), 0);
wait_pid = __waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
__libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
}
while (wait_pid == -1 && errno == EINTR);
if (wait_pid == -1)