jcs's openbsd hax
openbsd

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.

jca 13e54a3c a2d10271

+13 -24
+1
lib/libc/Symbols.list
··· 412 412 sigpending 413 413 sigprocmask 414 414 sigsuspend 415 + sigwait 415 416 socket 416 417 socketpair 417 418 stat
+3 -3
lib/libc/gen/Makefile.inc
··· 1 - # $OpenBSD: Makefile.inc,v 1.79 2018/10/30 16:28:42 guenther Exp $ 1 + # $OpenBSD: Makefile.inc,v 1.80 2019/01/12 00:16:03 jca Exp $ 2 2 3 3 # gen sources 4 4 .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/gen ${LIBCSRCDIR}/gen ··· 20 20 rewinddir.c scandir.c seekdir.c setdomainname.c sethostname.c \ 21 21 setprogname.c setmode.c setproctitle.c shm_open.c \ 22 22 siginterrupt.c siglist.c signal.c signame.c \ 23 - sigsetops.c sleep.c statvfs.c strtofflags.c sysconf.c \ 23 + sigsetops.c sigwait.c sleep.c statvfs.c strtofflags.c sysconf.c \ 24 24 syslog.c syslog_r.c telldir.c time.c times.c \ 25 25 timespec_get.c tolower_.c tree.c ttyname.c \ 26 26 ttyslot.c toupper_.c ualarm.c uname.c unvis.c usleep.c \ ··· 52 52 psignal.3 pw_dup.3 pwcache.3 raise.3 readpassphrase.3 \ 53 53 scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \ 54 54 siginterrupt.3 signal.3 \ 55 - sigaddset.3 sleep.3 statvfs.3 sysconf.3 strtofflags.3 \ 55 + sigaddset.3 sigwait.3 sleep.3 statvfs.3 sysconf.3 strtofflags.3 \ 56 56 syslog.3 time.3 times.3 timespec_get.3 toascii.3 tolower.3 toupper.3 \ 57 57 ttyname.3 ualarm.3 uname.3 unvis.3 usleep.3 utime.3 valloc.3 vis.3
+2 -1
lib/libc/hidden/signal.h
··· 1 - /* $OpenBSD: signal.h,v 1.14 2016/09/26 05:57:58 guenther Exp $ */ 1 + /* $OpenBSD: signal.h,v 1.15 2019/01/12 00:16:03 jca Exp $ */ 2 2 /* 3 3 * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> 4 4 * ··· 66 66 PROTO_DEPRECATED(sigsetmask); 67 67 PROTO_CANCEL(sigsuspend); 68 68 PROTO_DEPRECATED(sigvec); 69 + PROTO_DEPRECATED(sigwait); 69 70 PROTO_NORMAL(thrkill); 70 71 71 72 #endif /* !_LIBC_SIGNAL_H */
+1 -2
lib/libpthread/man/Makefile.inc
··· 1 - # $OpenBSD: Makefile.inc,v 1.36 2016/03/30 06:38:42 jmc Exp $ 1 + # $OpenBSD: Makefile.inc,v 1.37 2019/01/12 00:16:03 jca Exp $ 2 2 # $FreeBSD: Makefile.inc,v 1.6 1999/08/28 00:03:02 peter Exp $ 3 3 4 4 # POSIX thread man files ··· 74 74 sem_wait.3 75 75 76 76 MAN+= pthreads.3 \ 77 - sigwait.3 \ 78 77 flockfile.3 \ 79 78 getc_unlocked.3 \ 80 79 putc_unlocked.3
+3 -13
lib/libpthread/man/sigwait.3 lib/libc/gen/sigwait.3
··· 1 - .\" $OpenBSD: sigwait.3,v 1.15 2013/06/05 03:44:50 tedu Exp $ 1 + .\" $OpenBSD: sigwait.3,v 1.1 2019/01/12 00:16:03 jca Exp $ 2 2 .\" 3 3 .\" David Leonard <d@openbsd.org>, 1998. Public domain. 4 - .Dd $Mdocdate: June 5 2013 $ 4 + .Dd $Mdocdate: January 12 2019 $ 5 5 .Dt SIGWAIT 3 6 6 .Os 7 7 .Sh NAME ··· 48 48 Which thread returns from 49 49 .Fn sigwait 50 50 if more than a single thread is waiting is unspecified. 51 - .Pp 52 - .Sy Note : 53 - Code using the 54 - .Fn sigwait 55 - function must be compiled and linked with the 56 - .Cm -pthread 57 - option to 58 - .Xr gcc 1 . 59 51 .Sh RETURN VALUES 60 52 Upon successful completion, 61 53 .Fn sigwait ··· 76 68 .Xr sigaction 2 , 77 69 .Xr sigpending 2 , 78 70 .Xr sigsuspend 2 , 79 - .Xr pause 3 , 80 - .Xr pthread_sigmask 3 , 81 - .Xr pthreads 3 71 + .Xr pause 3 82 72 .Sh STANDARDS 83 73 .Fn sigwait 84 74 conforms to
+1 -2
lib/librthread/Makefile
··· 1 - # $OpenBSD: Makefile,v 1.53 2018/10/21 17:07:24 visa Exp $ 1 + # $OpenBSD: Makefile,v 1.54 2019/01/12 00:16:03 jca Exp $ 2 2 3 3 LIB=pthread 4 4 LIBCSRCDIR= ${.CURDIR}/../libc ··· 30 30 rthread_rwlock.c \ 31 31 rthread_rwlockattr.c \ 32 32 rthread_sched.c \ 33 - rthread_sig.c \ 34 33 rthread_stack.c \ 35 34 rthread_spin_lock.c \ 36 35 sched_prio.c
-1
lib/librthread/Symbols.map
··· 91 91 sem_trywait; 92 92 sem_unlink; 93 93 sem_wait; 94 - sigwait; 95 94 96 95 /* used for debugging & regress */ 97 96 _thread_dump_info;
+2 -2
lib/librthread/rthread_sig.c lib/libc/gen/sigwait.c
··· 1 - /* $OpenBSD: rthread_sig.c,v 1.18 2016/05/07 19:05:22 guenther Exp $ */ 1 + /* $OpenBSD: sigwait.c,v 1.1 2019/01/12 00:16:03 jca Exp $ */ 2 2 /* 3 3 * Copyright (c) 2005 Ted Unangst <tedu@openbsd.org> 4 4 * All Rights Reserved. ··· 24 24 25 25 #include <pthread.h> 26 26 27 - #include "rthread.h" 27 + #include "thread/rthread.h" 28 28 #include "cancel.h" /* in libc/include */ 29 29 30 30 int