123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #include <errno.h>
- #include <signal.h>
- #define __need_NULL
- #include <stddef.h>
- #include <sysdep-cancel.h>
- #include <sys/syscall.h>
- #include <bits/libc-lock.h>
- extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *,
- const struct timespec *, size_t);
- static __inline__ int
- do_sigwait (const sigset_t *set, int *sig)
- {
- int ret;
-
- #ifdef INTERNAL_SYSCALL
- INTERNAL_SYSCALL_DECL (err);
- ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, set,
- NULL, NULL, _NSIG / 8);
- if (! INTERNAL_SYSCALL_ERROR_P (ret, err))
- {
- *sig = ret;
- ret = 0;
- }
- else
- ret = INTERNAL_SYSCALL_ERRNO (ret, err);
- #else
- ret = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
- NULL, NULL, _NSIG / 8);
- if (ret != -1)
- {
- *sig = ret;
- ret = 0;
- }
- else
- ret = errno;
- #endif
- return ret;
- }
- #ifndef SHARED
- weak_extern (__pthread_sigwait)
- #endif
- int
- __sigwait (set, sig)
- const sigset_t *set;
- int *sig;
- {
- #ifndef NOT_IN_libc
- return __libc_maybe_call2 (pthread_sigwait, (set, sig),
- do_sigwait (set, sig));
- #else
- return do_sigwait (set, sig);
- #endif
- }
- libc_hidden_def (__sigwait)
- weak_alias (__sigwait, sigwait)
- strong_alias (__sigwait, __libc_sigwait)
- LIBC_CANCEL_HANDLED ();
|