summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-01-12 00:16:04 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-01-12 00:16:04 +0000
commit8ded0b217e7504ff919600fb3989616a98ad3a2c (patch)
tree7280fd3c7f0f7c66b412a4265ace7111a48f4fb3 /lib
parent050c4ad04cb765a6959da0c4b0006fb2cb530d10 (diff)
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')
-rw-r--r--lib/libc/Symbols.list1
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--lib/libc/gen/sigwait.3 (renamed from lib/libpthread/man/sigwait.3)16
-rw-r--r--lib/libc/gen/sigwait.c (renamed from lib/librthread/rthread_sig.c)4
-rw-r--r--lib/libc/hidden/signal.h3
-rw-r--r--lib/libpthread/man/Makefile.inc3
-rw-r--r--lib/librthread/Makefile3
-rw-r--r--lib/librthread/Symbols.map1
8 files changed, 13 insertions, 24 deletions
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list
index a0cb352cad0..06e9f6459e3 100644
--- a/lib/libc/Symbols.list
+++ b/lib/libc/Symbols.list
@@ -412,6 +412,7 @@ sigaltstack
sigpending
sigprocmask
sigsuspend
+sigwait
socket
socketpair
stat
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 107fe4889ae..6868bd745c0 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.79 2018/10/30 16:28:42 guenther Exp $
+# $OpenBSD: Makefile.inc,v 1.80 2019/01/12 00:16:03 jca Exp $
# gen sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/gen ${LIBCSRCDIR}/gen
@@ -20,7 +20,7 @@ SRCS+= alarm.c assert.c auth_subr.c authenticate.c \
rewinddir.c scandir.c seekdir.c setdomainname.c sethostname.c \
setprogname.c setmode.c setproctitle.c shm_open.c \
siginterrupt.c siglist.c signal.c signame.c \
- sigsetops.c sleep.c statvfs.c strtofflags.c sysconf.c \
+ sigsetops.c sigwait.c sleep.c statvfs.c strtofflags.c sysconf.c \
syslog.c syslog_r.c telldir.c time.c times.c \
timespec_get.c tolower_.c tree.c ttyname.c \
ttyslot.c toupper_.c ualarm.c uname.c unvis.c usleep.c \
@@ -52,6 +52,6 @@ MAN+= __tfork_thread.3 alarm.3 auth_subr.3 authenticate.3 basename.3 clock.3 \
psignal.3 pw_dup.3 pwcache.3 raise.3 readpassphrase.3 \
scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \
siginterrupt.3 signal.3 \
- sigaddset.3 sleep.3 statvfs.3 sysconf.3 strtofflags.3 \
+ sigaddset.3 sigwait.3 sleep.3 statvfs.3 sysconf.3 strtofflags.3 \
syslog.3 time.3 times.3 timespec_get.3 toascii.3 tolower.3 toupper.3 \
ttyname.3 ualarm.3 uname.3 unvis.3 usleep.3 utime.3 valloc.3 vis.3
diff --git a/lib/libpthread/man/sigwait.3 b/lib/libc/gen/sigwait.3
index bfafc55ebc8..1749c1107d8 100644
--- a/lib/libpthread/man/sigwait.3
+++ b/lib/libc/gen/sigwait.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: sigwait.3,v 1.15 2013/06/05 03:44:50 tedu Exp $
+.\" $OpenBSD: sigwait.3,v 1.1 2019/01/12 00:16:03 jca Exp $
.\"
.\" David Leonard <d@openbsd.org>, 1998. Public domain.
-.Dd $Mdocdate: June 5 2013 $
+.Dd $Mdocdate: January 12 2019 $
.Dt SIGWAIT 3
.Os
.Sh NAME
@@ -48,14 +48,6 @@ with the signal number.
Which thread returns from
.Fn sigwait
if more than a single thread is waiting is unspecified.
-.Pp
-.Sy Note :
-Code using the
-.Fn sigwait
-function must be compiled and linked with the
-.Cm -pthread
-option to
-.Xr gcc 1 .
.Sh RETURN VALUES
Upon successful completion,
.Fn sigwait
@@ -76,9 +68,7 @@ argument contains an invalid or unsupported signal number.
.Xr sigaction 2 ,
.Xr sigpending 2 ,
.Xr sigsuspend 2 ,
-.Xr pause 3 ,
-.Xr pthread_sigmask 3 ,
-.Xr pthreads 3
+.Xr pause 3
.Sh STANDARDS
.Fn sigwait
conforms to
diff --git a/lib/librthread/rthread_sig.c b/lib/libc/gen/sigwait.c
index 65d193cbf58..0321066fc81 100644
--- a/lib/librthread/rthread_sig.c
+++ b/lib/libc/gen/sigwait.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_sig.c,v 1.18 2016/05/07 19:05:22 guenther Exp $ */
+/* $OpenBSD: sigwait.c,v 1.1 2019/01/12 00:16:03 jca Exp $ */
/*
* Copyright (c) 2005 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -24,7 +24,7 @@
#include <pthread.h>
-#include "rthread.h"
+#include "thread/rthread.h"
#include "cancel.h" /* in libc/include */
int
diff --git a/lib/libc/hidden/signal.h b/lib/libc/hidden/signal.h
index 764a32f4fdc..7fdfcef7532 100644
--- a/lib/libc/hidden/signal.h
+++ b/lib/libc/hidden/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.14 2016/09/26 05:57:58 guenther Exp $ */
+/* $OpenBSD: signal.h,v 1.15 2019/01/12 00:16:03 jca Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -66,6 +66,7 @@ PROTO_WRAP(sigprocmask);
PROTO_DEPRECATED(sigsetmask);
PROTO_CANCEL(sigsuspend);
PROTO_DEPRECATED(sigvec);
+PROTO_DEPRECATED(sigwait);
PROTO_NORMAL(thrkill);
#endif /* !_LIBC_SIGNAL_H */
diff --git a/lib/libpthread/man/Makefile.inc b/lib/libpthread/man/Makefile.inc
index 4fb60aad301..00b3276aa40 100644
--- a/lib/libpthread/man/Makefile.inc
+++ b/lib/libpthread/man/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.36 2016/03/30 06:38:42 jmc Exp $
+# $OpenBSD: Makefile.inc,v 1.37 2019/01/12 00:16:03 jca Exp $
# $FreeBSD: Makefile.inc,v 1.6 1999/08/28 00:03:02 peter Exp $
# POSIX thread man files
@@ -74,7 +74,6 @@ MAN+= \
sem_wait.3
MAN+= pthreads.3 \
- sigwait.3 \
flockfile.3 \
getc_unlocked.3 \
putc_unlocked.3
diff --git a/lib/librthread/Makefile b/lib/librthread/Makefile
index b848dada3a6..f0a1c70e49d 100644
--- a/lib/librthread/Makefile
+++ b/lib/librthread/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.53 2018/10/21 17:07:24 visa Exp $
+# $OpenBSD: Makefile,v 1.54 2019/01/12 00:16:03 jca Exp $
LIB=pthread
LIBCSRCDIR= ${.CURDIR}/../libc
@@ -30,7 +30,6 @@ SRCS= rthread.c \
rthread_rwlock.c \
rthread_rwlockattr.c \
rthread_sched.c \
- rthread_sig.c \
rthread_stack.c \
rthread_spin_lock.c \
sched_prio.c
diff --git a/lib/librthread/Symbols.map b/lib/librthread/Symbols.map
index a7aa4ce407d..da37e9f787a 100644
--- a/lib/librthread/Symbols.map
+++ b/lib/librthread/Symbols.map
@@ -91,7 +91,6 @@
sem_trywait;
sem_unlink;
sem_wait;
- sigwait;
/* used for debugging & regress */
_thread_dump_info;