diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -414,8 +414,6 @@ int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *) __hidden; int __libc_sigsuspend(const __sigset_t *) __hidden; -int __libc_sigwait(const __sigset_t * __restrict, - int * restrict sig); int __libc_system(const char *); int __libc_tcdrain(int); int __fcntl_compat(int fd, int cmd, ...); diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -37,7 +37,8 @@ __getosreldate.c \ getpagesize.c \ getpagesizes.c \ - interposing_table.c + interposing_table.c \ + libsys_sigwait.c SRCS+= getdents.c lstat.c mknod.c stat.c diff --git a/lib/libsys/Symbol.sys.map b/lib/libsys/Symbol.sys.map --- a/lib/libsys/Symbol.sys.map +++ b/lib/libsys/Symbol.sys.map @@ -433,7 +433,6 @@ FBSDprivate_1.0 { /* Add entries in sort(1) order */ - __libc_sigwait; __libsys_interposing_slot; __set_error_selector; __sigwait; diff --git a/lib/libsys/interposing_table.c b/lib/libsys/interposing_table.c --- a/lib/libsys/interposing_table.c +++ b/lib/libsys/interposing_table.c @@ -29,9 +29,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include "libc_private.h" +int __libsys_sigwait(const sigset_t *set, int *sig); + #define SLOT(a, b) \ [INTERPOS_##a] = (interpos_func_t)b interpos_func_t __libsys_interposing[INTERPOS_MAX] = { @@ -59,7 +62,7 @@ SLOT(sigaction, __sys_sigaction), SLOT(sigprocmask, __sys_sigprocmask), SLOT(sigsuspend, __sys_sigsuspend), - SLOT(sigwait, __libc_sigwait), + SLOT(sigwait, __libsys_sigwait), SLOT(sigtimedwait, __sys_sigtimedwait), SLOT(sigwaitinfo, __sys_sigwaitinfo), SLOT(swapcontext, __sys_swapcontext), diff --git a/lib/libsys/sigwait.c b/lib/libsys/libsys_sigwait.c copy from lib/libsys/sigwait.c copy to lib/libsys/libsys_sigwait.c --- a/lib/libsys/sigwait.c +++ b/lib/libsys/libsys_sigwait.c @@ -25,27 +25,20 @@ * SUCH DAMAGE. */ -#include #include +#include #include "libc_private.h" -__weak_reference(__libc_sigwait, __sigwait); - -#pragma weak sigwait -int -sigwait(const sigset_t *set, int *sig) -{ - return (((int (*)(const sigset_t *, int *)) - __libsys_interposing[INTERPOS_sigwait])(set, sig)); -} +/* XXX: why does this symbol exist? */ +__weak_reference(__libsys_sigwait, __sigwait); int -__libc_sigwait(const sigset_t *set, int *sig) +__libsys_sigwait(const sigset_t *set, int *sig) { int ret; /* POSIX does not allow EINTR to be returned */ - do { + do { ret = __sys_sigwait(set, sig); } while (ret == EINTR); return (ret); diff --git a/lib/libsys/sigwait.c b/lib/libsys/sigwait.c --- a/lib/libsys/sigwait.c +++ b/lib/libsys/sigwait.c @@ -25,12 +25,9 @@ * SUCH DAMAGE. */ -#include #include #include "libc_private.h" -__weak_reference(__libc_sigwait, __sigwait); - #pragma weak sigwait int sigwait(const sigset_t *set, int *sig) @@ -38,15 +35,3 @@ return (((int (*)(const sigset_t *, int *)) __libsys_interposing[INTERPOS_sigwait])(set, sig)); } - -int -__libc_sigwait(const sigset_t *set, int *sig) -{ - int ret; - - /* POSIX does not allow EINTR to be returned */ - do { - ret = __sys_sigwait(set, sig); - } while (ret == EINTR); - return (ret); -}