summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-04-13 08:25:37 +0000
committerguenther <guenther@openbsd.org>2012-04-13 08:25:37 +0000
commit81efc908d4d2301d4071d3d5d313a90fe7083472 (patch)
treec4254445ebcef8029eff241d1716ed0964e616a0
parentRemove 'struct _dirdesc' description and dirfd() macro defintion from (diff)
downloadwireguard-openbsd-81efc908d4d2301d4071d3d5d313a90fe7083472.tar.xz
wireguard-openbsd-81efc908d4d2301d4071d3d5d313a90fe7083472.zip
Add sigwaitinfo and sigtimedwait stubs under #if 0; a bit more kernel
support is needed before they can be usefully enabled but I don't want to misplace this diff yet again
-rw-r--r--lib/librthread/rthread_sig.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/lib/librthread/rthread_sig.c b/lib/librthread/rthread_sig.c
index c38fed3998b..df822b01467 100644
--- a/lib/librthread/rthread_sig.c
+++ b/lib/librthread/rthread_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_sig.c,v 1.12 2012/01/17 02:34:18 guenther Exp $ */
+/* $OpenBSD: rthread_sig.c,v 1.13 2012/04/13 08:25:37 guenther Exp $ */
/*
* Copyright (c) 2005 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -64,6 +64,45 @@ sigwait(const sigset_t *set, int *sig)
return (0);
}
+#if 0 /* need kernel to fill in more siginfo_t bits first */
+int
+sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+ pthread_t self = pthread_self();
+ sigset_t s = *set;
+ int ret;
+
+ sigdelset(&s, SIGTHR);
+ _enter_cancel(self);
+ ret = __thrsigdivert(s, info, NULL);
+ _leave_cancel(self);
+ return (ret);
+}
+
+int
+sigtimedwait(const sigset_t *set, siginfo_t *info,
+ const struct timespec *timeout)
+{
+ pthread_t self = pthread_self();
+ sigset_t s = *set;
+ int ret;
+
+ sigdelset(&s, SIGTHR);
+ _enter_cancel(self);
+ ret = __thrsigdivert(s, info, timeout);
+ _leave_cancel(self);
+ return (ret);
+}
+#endif
+
+#if 0 /* belongs in libc */
+int
+raise(int sig)
+{
+ return (kill(getthrid(), sig));
+}
+#endif
+
int
sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
{