mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Consolidate non cancellable waitpid call
This patch consolidates all the non cancellable waitpid calls to use the __waitpid_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * libio/ioopen.c (_IO_waitpid): Replace waitpid_not_cancel with __waitpid_nocancel. * sysdeps/generic/not-cancel.h (waitpid_not_cancel): Remove macro. (__waitpid_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (waitpid_not_cancel): Remove macro. (__waitpid_nocancel): Replace macro with a function. * sysdeps/unix/sysv/linux/waitpid.c (__waitpid_nocancel): New function.
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include <sysdep-cancel.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <not-cancel.h>
|
||||
|
||||
__pid_t
|
||||
__waitpid (__pid_t pid, int *stat_loc, int options)
|
||||
@ -31,3 +32,14 @@ __waitpid (__pid_t pid, int *stat_loc, int options)
|
||||
}
|
||||
libc_hidden_def (__waitpid)
|
||||
weak_alias (__waitpid, waitpid)
|
||||
|
||||
__pid_t
|
||||
__waitpid_nocancel (__pid_t pid, int *stat_loc, int options)
|
||||
{
|
||||
#ifdef __NR_waitpid
|
||||
return INLINE_SYSCALL_CALL (waitpid, pid, stat_loc, options);
|
||||
#else
|
||||
return INLINE_SYSCALL_CALL (wait4, pid, stat_loc, options, NULL);
|
||||
#endif
|
||||
}
|
||||
libc_hidden_def (__waitpid_nocancel)
|
||||
|
Reference in New Issue
Block a user