1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #include <sys/syscall.h>
- #ifdef __NR_rt_sigtimedwait
- # include <signal.h>
- # include <cancel.h>
- # ifdef __UCLIBC_HAS_THREADS_NATIVE__
- # include <pthreadP.h> /* SIGCANCEL */
- # endif
- # ifdef SIGCANCEL
- # define __need_NULL
- # include <stddef.h>
- # include <string.h>
- # endif
- int __NC(sigtimedwait)(const sigset_t *set, siginfo_t *info,
- const struct timespec *timeout)
- {
- # ifdef SIGCANCEL
- sigset_t tmpset;
- if (set != NULL && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
- # ifdef SIGSETXID
- || __builtin_expect (__sigismember (set, SIGSETXID), 0)
- # endif
- ))
- {
-
-
- memcpy (&tmpset, set, _NSIG / 8);
- __sigdelset (&tmpset, SIGCANCEL);
- # ifdef SIGSETXID
- __sigdelset (&tmpset, SIGSETXID);
- # endif
- set = &tmpset;
- }
- # endif
- # if defined SI_TKILL && defined SI_USER
-
-
- int result = INLINE_SYSCALL(rt_sigtimedwait, 4, set, info,
- timeout, __SYSCALL_SIGSET_T_SIZE);
-
- if (result != -1 && info != NULL && info->si_code == SI_TKILL)
- info->si_code = SI_USER;
- return result;
- # else
-
- return INLINE_SYSCALL(rt_sigtimedwait, 4, set, info,
- timeout, __SYSCALL_SIGSET_T_SIZE);
- # endif
- }
- CANCELLABLE_SYSCALL(int, sigtimedwait,
- (const sigset_t *set, siginfo_t *info, const struct timespec *timeout),
- (set, info, timeout))
- lt_libc_hidden(sigtimedwait)
- #endif
|