diff options
author | 2019-01-12 00:16:03 +0000 | |
---|---|---|
committer | 2019-01-12 00:16:03 +0000 | |
commit | 13e54a3ce65615faaf13e4717a510eb52bfb2efe (patch) | |
tree | 4b1f38bf64a53a711863123ff48c2aa908106c50 /lib/librthread/rthread_sig.c | |
parent | disable the correct performance options, per-architecture (diff) | |
download | wireguard-openbsd-13e54a3ce65615faaf13e4717a510eb52bfb2efe.tar.xz wireguard-openbsd-13e54a3ce65615faaf13e4717a510eb52bfb2efe.zip |
Move sigwait(3) from libpthread to libc
POSIX wants it in libc, that's where the function can be found on other
systems. Reported by naddy@, input from naddy@ and guenther@.
"looks ok" guenther@, ok deraadt@
Note: riding the libc/libpthread major cranks earlier today.
Diffstat (limited to 'lib/librthread/rthread_sig.c')
-rw-r--r-- | lib/librthread/rthread_sig.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/librthread/rthread_sig.c b/lib/librthread/rthread_sig.c deleted file mode 100644 index 65d193cbf58..00000000000 --- a/lib/librthread/rthread_sig.c +++ /dev/null @@ -1,75 +0,0 @@ -/* $OpenBSD: rthread_sig.c,v 1.18 2016/05/07 19:05:22 guenther Exp $ */ -/* - * Copyright (c) 2005 Ted Unangst <tedu@openbsd.org> - * All Rights Reserved. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -/* - * signals - */ - -#include <signal.h> -#include <errno.h> - -#include <pthread.h> - -#include "rthread.h" -#include "cancel.h" /* in libc/include */ - -int -sigwait(const sigset_t *set, int *sig) -{ - sigset_t s = *set; - int ret; - - sigdelset(&s, SIGTHR); - do { - ENTER_CANCEL_POINT(1); - ret = __thrsigdivert(s, NULL, NULL); - LEAVE_CANCEL_POINT(ret == -1); - } while (ret == -1 && errno == EINTR); - if (ret == -1) - return (errno); - *sig = ret; - return (0); -} - -#if 0 /* need kernel to fill in more siginfo_t bits first */ -int -sigwaitinfo(const sigset_t *set, siginfo_t *info) -{ - sigset_t s = *set; - int ret; - - sigdelset(&s, SIGTHR); - ENTER_CANCEL_POINT(1); - ret = __thrsigdivert(s, info, NULL); - LEAVE_CANCEL_POINT(ret == -1); - return (ret); -} - -int -sigtimedwait(const sigset_t *set, siginfo_t *info, - const struct timespec *timeout) -{ - sigset_t s = *set; - int ret; - - sigdelset(&s, SIGTHR); - ENTER_CANCEL_POINT(1); - ret = __thrsigdivert(s, info, timeout); - LEAVE_CANCEL_POINT(ret == -1); - return (ret); -} -#endif |