summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_sigsuspend.c
diff options
context:
space:
mode:
authorJonathan Mini <mini@FreeBSD.org>2002-09-16 19:52:52 +0000
committerJonathan Mini <mini@FreeBSD.org>2002-09-16 19:52:52 +0000
commit255ab70cdf6eb0005e7494657f35d318f666de50 (patch)
tree19954471d255ce812e704c80bd079f406bc31378 /lib/libpthread/thread/thr_sigsuspend.c
parent51f42932d165603bcfdafe9d900a392fd821a9eb (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_sigsuspend.c')
-rw-r--r--lib/libpthread/thread/thr_sigsuspend.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/lib/libpthread/thread/thr_sigsuspend.c b/lib/libpthread/thread/thr_sigsuspend.c
index 90638f4a458d..dc805ac38314 100644
--- a/lib/libpthread/thread/thr_sigsuspend.c
+++ b/lib/libpthread/thread/thr_sigsuspend.c
@@ -41,60 +41,12 @@
__weak_reference(__sigsuspend, sigsuspend);
int
-_sigsuspend(const sigset_t * set)
-{
- struct pthread *curthread = _get_curthread();
- int ret = -1;
- sigset_t oset, sigset;
-
- /* Check if a new signal set was provided by the caller: */
- if (set != NULL) {
- /* Save the current signal mask: */
- oset = curthread->sigmask;
-
- /* Change the caller's mask: */
- curthread->sigmask = *set;
-
- /*
- * Check if there are pending signals for the running
- * thread or process that aren't blocked:
- */
- sigset = curthread->sigpend;
- SIGSETOR(sigset, _process_sigpending);
- SIGSETNAND(sigset, curthread->sigmask);
- if (SIGNOTEMPTY(sigset)) {
- /*
- * Call the kernel scheduler which will safely
- * install a signal frame for the running thread:
- */
- _thread_kern_sched_sig();
- } else {
- /* Wait for a signal: */
- _thread_kern_sched_state(PS_SIGSUSPEND,
- __FILE__, __LINE__);
- }
-
- /* Always return an interrupted error: */
- errno = EINTR;
-
- /* Restore the signal mask: */
- curthread->sigmask = oset;
- } else {
- /* Return an invalid argument error: */
- errno = EINVAL;
- }
-
- /* Return the completion status: */
- return (ret);
-}
-
-int
__sigsuspend(const sigset_t * set)
{
int ret;
_thread_enter_cancellation_point();
- ret = _sigsuspend(set);
+ ret = __sys_sigsuspend(set);
_thread_leave_cancellation_point();
return ret;