12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include <pthreadP.h>
- #include <errno.h>
- #include <signal.h>
- #include <string.h>
- #include <sysdep-cancel.h>
- #include <sys/syscall.h>
- #ifdef __NR_rt_sigtimedwait
- static int
- do_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
-
- int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
- info, timeout, _NSIG / 8);
-
- if (result != -1 && info != NULL && info->si_code == SI_TKILL)
- info->si_code = SI_USER;
- return result;
- }
- int
- __sigtimedwait (const sigset_t *set, siginfo_t *info,
- const struct timespec *timeout)
- {
- if (SINGLE_THREAD_P)
- return do_sigtimedwait (set, info, timeout);
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = do_sigtimedwait (set, info, timeout);
- LIBC_CANCEL_RESET (oldtype);
- return result;
- }
- weak_alias (__sigtimedwait, sigtimedwait)
- #endif
|