mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Simplify Linux sig{timed}wait{info} implementations
This patch simplifies sig{timed}wait{info} by:
- Assuming __NR_rt_sigtimedwait existence on all architectures due minimum
kernel version requirement (it pre-dates Linux git inclusion for Linux
2.6.12).
- Call __sigtimedwait on both sigwait and sigwaitinfo.
- Now that sigwait is based on an internal sigtimedwait call and it is
present of both libc.so and libpthread.so we need to add an external
private definition of __sigtimedwait for libpthread.so call.
Checked on x86_64-linux-gnu.
* sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add
__sigtimedwait.
* sysdeps/unix/sysv/linux/sigtimedwait.c: Simplify includes and
assume __NR_rt_sigtimedwait.
* sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Call __sigtimedwait
and add LIBC_CANCEL_HANDLED for cancellation marking.
* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
This commit is contained in:
@@ -18,12 +18,7 @@
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nptl/pthreadP.h>
|
||||
#include <sysdep-cancel.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#ifdef __NR_rt_sigtimedwait
|
||||
|
||||
int
|
||||
__sigtimedwait (const sigset_t *set, siginfo_t *info,
|
||||
@@ -57,6 +52,3 @@ __sigtimedwait (const sigset_t *set, siginfo_t *info,
|
||||
}
|
||||
libc_hidden_def (__sigtimedwait)
|
||||
weak_alias (__sigtimedwait, sigtimedwait)
|
||||
#else
|
||||
# include <signal/sigtimedwait.c>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user