From 518dbaed2b84867e94a04db62105b358cf9f6564 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Tue, 2 Jun 2020 00:36:09 +0200 Subject: [PATCH 5/5] Rename pollts to ppoll --- distrib/sets/lists/comp/mi | 9 +++-- lib/libc/compat/sys/compat_select.c | 15 ++++++++- lib/libc/include/namespace.h | 1 + lib/libc/rpc/clnt_bcast.c | 4 +-- lib/libc/rpc/clnt_dg.c | 2 +- lib/libc/rpc/clnt_vc.c | 2 +- lib/libc/rpc/svc.c | 2 +- lib/libc/rpc/svc_fdset.h | 4 +-- lib/libc/rpc/svc_vc.c | 2 +- lib/libc/sys/Makefile.inc | 4 +-- lib/libc/sys/poll.2 | 17 ++++++---- lib/libpthread/pthread_cancelstub.c | 17 ++++++++++ lib/libpthread/pthread_testcancel.3 | 2 +- lib/librumphijack/hijack.c | 40 ++++++++++++---------- sys/compat/sys/poll.h | 2 ++ sys/kern/sys_sig.c | 2 +- sys/rump/include/rump/rump_syscalls.h | 2 +- sys/sys/poll.h | 2 ++ tests/lib/libc/gen/t_sleep.c | 2 +- tests/lib/libc/sys/t_poll.c | 48 +++++++++++++-------------- usr.sbin/makemandb/nostem.txt | 1 + 21 files changed, 114 insertions(+), 66 deletions(-) diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi index f539cb5a1bc5..fc74a816e070 100644 --- a/distrib/sets/lists/comp/mi +++ b/distrib/sets/lists/comp/mi @@ -4518,8 +4518,9 @@ ./usr/share/man/cat2/pipe2.0 comp-c-catman .cat ./usr/share/man/cat2/pmc_control.0 comp-obsolete obsolete ./usr/share/man/cat2/pmc_get_info.0 comp-obsolete obsolete +./usr/share/man/cat2/ppoll.0 comp-c-catman .cat ./usr/share/man/cat2/poll.0 comp-c-catman .cat -./usr/share/man/cat2/pollts.0 comp-c-catman .cat +./usr/share/man/cat2/pollts.0 comp-obsolete obsolete ./usr/share/man/cat2/posix_fadvise.0 comp-c-catman .cat ./usr/share/man/cat2/posix_fallocate.0 comp-c-catman .cat ./usr/share/man/cat2/posix_madvise.0 comp-c-catman .cat @@ -12682,8 +12683,9 @@ ./usr/share/man/html2/pipe2.html comp-c-htmlman html ./usr/share/man/html2/pmc_control.html comp-obsolete obsolete ./usr/share/man/html2/pmc_get_info.html comp-obsolete obsolete +./usr/share/man/html2/ppoll.html comp-c-htmlman html ./usr/share/man/html2/poll.html comp-c-htmlman html -./usr/share/man/html2/pollts.html comp-c-htmlman html +./usr/share/man/html2/pollts.html comp-obsolete obsolete ./usr/share/man/html2/posix_fadvise.html comp-c-htmlman html ./usr/share/man/html2/posix_fallocate.html comp-c-htmlman html ./usr/share/man/html2/posix_madvise.html comp-c-htmlman html @@ -20674,8 +20676,9 @@ ./usr/share/man/man2/pipe2.2 comp-c-man .man ./usr/share/man/man2/pmc_control.2 comp-obsolete obsolete ./usr/share/man/man2/pmc_get_info.2 comp-obsolete obsolete +./usr/share/man/man2/ppoll.2 comp-c-man .man ./usr/share/man/man2/poll.2 comp-c-man .man -./usr/share/man/man2/pollts.2 comp-c-man .man +./usr/share/man/man2/pollts.2 comp-obsolete obsolete ./usr/share/man/man2/posix_fadvise.2 comp-c-man .man ./usr/share/man/man2/posix_fallocate.2 comp-c-man .man ./usr/share/man/man2/posix_madvise.2 comp-c-man .man diff --git a/lib/libc/compat/sys/compat_select.c b/lib/libc/compat/sys/compat_select.c index c81de97a9d72..0e253302e7d4 100644 --- a/lib/libc/compat/sys/compat_select.c +++ b/lib/libc/compat/sys/compat_select.c @@ -47,6 +47,8 @@ __RCSID("$NetBSD: compat_select.c,v 1.2 2009/01/11 02:46:26 christos Exp $"); __warn_references(pollts, "warning: reference to compatibility pollts(); include to generate correct reference") +__warn_references(__pollts50, + "warning: this program uses pollts(), which is deprecated.") __warn_references(select, "warning: reference to compatibility select(); include to generate correct reference") __warn_references(pselect, @@ -59,6 +61,8 @@ __weak_alias(pselect, _pselect) __weak_alias(_sys_pselect, _pselect) __weak_alias(pollts, _pollts) __weak_alias(_sys_pollts, _pollts) +__weak_alias(__pollts50, _sys___pollts50) +__weak_alias(___pollts50, _sys___pollts50) #endif int pollts(struct pollfd * __restrict fds, nfds_t nfds, @@ -71,7 +75,16 @@ pollts(struct pollfd * __restrict fds, nfds_t nfds, timespec50_to_timespec(tim50, timp = &tim); else timp = NULL; - return __pollts50(fds, nfds, timp, sigmask); + return ppoll(fds, nfds, timp, sigmask); +} + +int +__pollts50(struct pollfd * __restrict fds, nfds_t nfds, + const struct timespec * __restrict tim, + const sigset_t * __restrict sigmask) +{ + + return ppoll(fds, nfds, tim, sigmask); } int diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 9d4242f559fe..d3a618ad3138 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -556,6 +556,7 @@ #define pmap_unset _pmap_unset #define paccept _paccept #define pollts _pollts +#define __pollts50 _sys___pollts50 #define popen _popen #define posix2time _posix2time #define posix2time_z _posix2time_z diff --git a/lib/libc/rpc/clnt_bcast.c b/lib/libc/rpc/clnt_bcast.c index 1985f2cefca8..34e60f76adbb 100644 --- a/lib/libc/rpc/clnt_bcast.c +++ b/lib/libc/rpc/clnt_bcast.c @@ -525,7 +525,7 @@ rpc_broadcast_exp( ts.tv_sec = msec / 1000; ts.tv_nsec = (msec % 1000) * 1000000; - switch (pollretval = pollts(pfd, fdlistno, &ts, NULL)) { + switch (pollretval = ppoll(pfd, fdlistno, &ts, NULL)) { case 0: /* timed out */ stat = RPC_TIMEDOUT; continue; @@ -542,7 +542,7 @@ rpc_broadcast_exp( else if (pfd[i].revents & POLLNVAL) { /* * Something bad has happened to this descri- - * ptor. We can cause pollts() to ignore + * ptor. We can cause ppoll() to ignore * it simply by using a negative fd. We do that * rather than compacting the pfd[] and fdlist[] * arrays. diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index 76dd576a5261..5c8f1047cbb1 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -410,7 +410,7 @@ send_again: tv.tv_sec = tv.tv_usec = 0; TIMEVAL_TO_TIMESPEC(&tv, &ts); - n = pollts(&cu->cu_pfdp, 1, &ts, maskp); + n = ppoll(&cu->cu_pfdp, 1, &ts, maskp); if (n == 1) { /* We have some data now */ do { diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index 155996887043..b071e3417cc5 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -705,7 +705,7 @@ read_vc(char *ctp, char *buf, int len) fd.fd = ct->ct_fd; fd.events = POLLIN; for (;;) { - switch (pollts(&fd, 1, &ts, NULL)) { + switch (ppoll(&fd, 1, &ts, NULL)) { case 0: ct->ct_error.re_status = RPC_TIMEDOUT; return (-1); diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 798ade0f6a15..b7125e7ca5ca 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -780,7 +780,7 @@ svc_getreq_poll(struct pollfd *pfdp, int pollretval) /* * We assume that this function is only called * via someone select()ing from svc_fdset or - * pollts()ing from svc_pollset[]. Thus it's safe + * ppoll()ing from svc_pollset[]. Thus it's safe * to handle the POLLNVAL event by simply turning * the corresponding bit off in the fdset. The * svc_pollset[] array is derived from svc_fdset diff --git a/lib/libc/rpc/svc_fdset.h b/lib/libc/rpc/svc_fdset.h index 838cf9070af8..ab9730d0f613 100644 --- a/lib/libc/rpc/svc_fdset.h +++ b/lib/libc/rpc/svc_fdset.h @@ -11,8 +11,8 @@ # define read(a, b, c) rump_sys_read(a, b, c) # undef write # define write(a, b, c) rump_sys_write(a, b, c) -# undef pollts -# define pollts(a, b, c, d) rump_sys_pollts(a, b, c, d) +# undef ppoll +# define ppoll(a, b, c, d) rump_sys_ppoll(a, b, c, d) # undef select # define select(a, b, c, d, e) rump_sys_select(a, b, c, d, e) # endif diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c index 045b63e30e0a..86f2dbcf549b 100644 --- a/lib/libc/rpc/svc_vc.c +++ b/lib/libc/rpc/svc_vc.c @@ -537,7 +537,7 @@ read_vc(caddr_t xprtp, caddr_t buf, int len) do { pollfd.fd = sock; pollfd.events = POLLIN; - switch (pollts(&pollfd, 1, &ts, NULL)) { + switch (ppoll(&pollfd, 1, &ts, NULL)) { case -1: if (errno == EINTR) { continue; diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 83e3bbc523f7..0031ba4329a7 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -177,7 +177,7 @@ WEAKASM= accept.S __aio_suspend50.S close.S connect.S execve.S \ fsync_range.S __kevent50.S \ kill.S mq_receive.S mq_send.S __mq_timedreceive50.S __mq_timedsend50.S \ msgrcv.S msgsnd.S __msync13.S __nanosleep50.S open.S paccept.S poll.S \ - __pollts50.S __pselect50.S read.S readlink.S \ + ppoll.S __pselect50.S read.S readlink.S \ readv.S _sched_setparam.S _sched_getparam.S _sched_setaffinity.S \ _sched_getaffinity.S sched_yield.S _sched_protect.S \ __select50.S setcontext.S __sigprocmask14.S __sigsuspend14.S sysarch.S \ @@ -359,7 +359,7 @@ MLINKS+=mount.2 unmount.2 MLINKS+=open.2 openat.2 MLINKS+=ntp_adjtime.2 ntp_gettime.2 MLINKS+=pathconf.2 fpathconf.2 -MLINKS+=poll.2 pollts.2 +MLINKS+=poll.2 ppoll.2 MLINKS+=read.2 readv.2 read.2 pread.2 read.2 preadv.2 MLINKS+=readlink.2 readlinkat.2 MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2 recv.2 recvmmsg.2 diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2 index 02b59e4de505..352d5e69a0e8 100644 --- a/lib/libc/sys/poll.2 +++ b/lib/libc/sys/poll.2 @@ -31,7 +31,7 @@ .Dt POLL 2 .Os .Sh NAME -.Nm poll, pollts +.Nm poll, ppoll .Nd synchronous I/O multiplexing .Sh LIBRARY .Lb libc @@ -43,11 +43,11 @@ .In signal.h .In time.h .Ft int -.Fn pollts "struct pollfd * restrict fds" "nfds_t nfds" "const struct timespec * restrict ts" "const sigset_t * restrict sigmask" +.Fn ppoll "struct pollfd * restrict fds" "nfds_t nfds" "const struct timespec * restrict ts" "const sigset_t * restrict sigmask" .Sh DESCRIPTION .Fn poll and -.Fn pollts +.Fn ppoll examine a set of file descriptors to see if some of them are ready for I/O. The @@ -160,18 +160,18 @@ maximum interval to wait for any file descriptor to become ready. If .Fa ts is a null pointer, -.Fn pollts +.Fn ppoll blocks indefinitely. If .Fa ts is a non-null pointer, referencing a zero-valued timespec structure, then -.Fn pollts +.Fn ppoll will return without blocking. .Pp If .Fa sigmask is a non-null pointer, then the -.Fn pollts +.Fn ppoll function shall replace the signal mask of the caller by the set of signals pointed to by .Fa sigmask @@ -239,6 +239,11 @@ The .Fn pollts function first appeared in .Nx 3.0 . +.Fn pollts +was renamed to +.Fn ppoll +in +.Nx 10 . .Sh BUGS The distinction between some of the fields in the .Fa events diff --git a/lib/libpthread/pthread_cancelstub.c b/lib/libpthread/pthread_cancelstub.c index 369ab39dd658..fa464abf62c9 100644 --- a/lib/libpthread/pthread_cancelstub.c +++ b/lib/libpthread/pthread_cancelstub.c @@ -113,6 +113,8 @@ int _sys_open(const char *, int, ...); int _sys_poll(struct pollfd *, nfds_t, int); int _sys___pollts50(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); +int _sys_ppoll(struct pollfd *, nfds_t, const struct timespec *, + const sigset_t *); ssize_t _sys_pread(int, void *, size_t, off_t); int _sys___pselect50(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); @@ -430,6 +432,21 @@ __pollts50(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, return retval; } +int +ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, + const sigset_t *sigmask) +{ + int retval; + pthread_t self; + + self = pthread__self(); + TESTCANCEL(self); + retval = _sys_ppoll(fds, nfds, ts, sigmask); + TESTCANCEL(self); + + return retval; +} + ssize_t pread(int d, void *buf, size_t nbytes, off_t offset) { diff --git a/lib/libpthread/pthread_testcancel.3 b/lib/libpthread/pthread_testcancel.3 index 4c3858a31910..09f80e600382 100644 --- a/lib/libpthread/pthread_testcancel.3 +++ b/lib/libpthread/pthread_testcancel.3 @@ -147,8 +147,8 @@ functions: .Fn nanosleep , .Fn open , .Fn pause , +.Fn ppoll , .Fn poll , -.Fn pollts , .Fn pread , .Fn pselect , .Fn pthread_cond_timedwait , diff --git a/lib/librumphijack/hijack.c b/lib/librumphijack/hijack.c index 81f8f4c6fb3c..845b12c3b423 100644 --- a/lib/librumphijack/hijack.c +++ b/lib/librumphijack/hijack.c @@ -102,7 +102,7 @@ enum dualcall { DUALCALL_READ, DUALCALL_READV, DUALCALL_PREAD, DUALCALL_PREADV, DUALCALL_DUP2, DUALCALL_CLOSE, - DUALCALL_POLLTS, + DUALCALL_PPOLL, #ifndef __linux__ DUALCALL_STAT, DUALCALL_LSTAT, DUALCALL_FSTAT, @@ -188,7 +188,7 @@ enum dualcall { #if !__NetBSD_Prereq__(5,99,7) #define REALSELECT select -#define REALPOLLTS pollts +#define REALPPOLL pollts #define REALKEVENT kevent #define REALSTAT __stat30 #define REALLSTAT __lstat30 @@ -200,7 +200,11 @@ enum dualcall { #define REALFHSTAT __fhstat40 #else /* >= 5.99.7 */ #define REALSELECT _sys___select50 -#define REALPOLLTS _sys___pollts50 +#if !__NetBSD_Prereq__(9,99,65) +#define REALPPOLL _sys___pollts50 +#else +#define REALPPOLL _sys_ppoll +#endif #define REALKEVENT _sys___kevent50 #define REALSTAT __stat50 #define REALLSTAT __lstat50 @@ -249,7 +253,7 @@ int __getcwd(char *, size_t); #define REALPREAD pread #define REALPWRITE pwrite #define REALSELECT select -#define REALPOLLTS ppoll +#define REALPPOLL ppoll #define REALUTIMES utimes #define REALLUTIMES lutimes #define REALFUTIMES futimes @@ -263,7 +267,7 @@ int __getcwd(char *, size_t); #endif /* platform */ int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *); -int REALPOLLTS(struct pollfd *, nfds_t, +int REALPPOLL(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); int REALKEVENT(int, const struct kevent *, size_t, struct kevent *, size_t, const struct timespec *); @@ -318,7 +322,7 @@ struct sysnames { { DUALCALL_FCNTL, "fcntl", RSYS_NAME(FCNTL) }, { DUALCALL_DUP2, "dup2", RSYS_NAME(DUP2) }, { DUALCALL_CLOSE, "close", RSYS_NAME(CLOSE) }, - { DUALCALL_POLLTS, S(REALPOLLTS), RSYS_NAME(POLLTS) }, + { DUALCALL_PPOLL, S(REALPPOLL), RSYS_NAME(PPOLL) }, #ifndef __linux__ { DUALCALL_STAT, S(REALSTAT), RSYS_NAME(STAT) }, { DUALCALL_LSTAT, S(REALLSTAT), RSYS_NAME(LSTAT) }, @@ -2026,7 +2030,7 @@ REALSELECT(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, TIMEVAL_TO_TIMESPEC(timeout, &ts); tsp = &ts; } - rv = REALPOLLTS(pfds, realnfds, tsp, NULL); + rv = REALPPOLL(pfds, realnfds, tsp, NULL); /* * "If select() returns with an error the descriptor sets * will be unmodified" @@ -2121,13 +2125,13 @@ struct pollarg { static void * hostpoll(void *arg) { - int (*op_pollts)(struct pollfd *, nfds_t, const struct timespec *, + int (*op_ppoll)(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); struct pollarg *parg = arg; intptr_t rv; - op_pollts = GETSYSCALL(host, POLLTS); - rv = op_pollts(parg->pfds, parg->nfds, parg->ts, parg->sigmask); + op_ppoll = GETSYSCALL(host, PPOLL); + rv = op_ppoll(parg->pfds, parg->nfds, parg->ts, parg->sigmask); if (rv == -1) parg->errnum = errno; rump_sys_write(parg->pipefd, &rv, sizeof(rv)); @@ -2136,10 +2140,10 @@ hostpoll(void *arg) } int -REALPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, +REALPPOLL(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, const sigset_t *sigmask) { - int (*op_pollts)(struct pollfd *, nfds_t, const struct timespec *, + int (*op_ppoll)(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); int (*host_close)(int); int hostcall = 0, rumpcall = 0; @@ -2244,8 +2248,8 @@ REALPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, parg.pipefd = rpipe[1]; pthread_create(&pt, NULL, hostpoll, &parg); - op_pollts = GETSYSCALL(rump, POLLTS); - rv_rump = op_pollts(pfd_rump, nfds+1, ts, NULL); + op_ppoll = GETSYSCALL(rump, PPOLL); + rv_rump = op_ppoll(pfd_rump, nfds+1, ts, NULL); errno_rump = errno; write(hpipe[1], &rv, sizeof(rv)); pthread_join(pt, &trv_val); @@ -2315,13 +2319,13 @@ REALPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, errno = sverrno; } else { if (hostcall) { - op_pollts = GETSYSCALL(host, POLLTS); + op_ppoll = GETSYSCALL(host, PPOLL); } else { - op_pollts = GETSYSCALL(rump, POLLTS); + op_ppoll = GETSYSCALL(rump, PPOLL); adjustpoll(fds, nfds, fd_host2rump); } - rv = op_pollts(fds, nfds, ts, sigmask); + rv = op_ppoll(fds, nfds, ts, sigmask); if (rumpcall) adjustpoll(fds, nfds, fd_rump2host_withdup); } @@ -2342,7 +2346,7 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout) tsp = &ts; } - return REALPOLLTS(fds, nfds, tsp, NULL); + return REALPPOLL(fds, nfds, tsp, NULL); } #ifdef HAVE_KQUEUE diff --git a/sys/compat/sys/poll.h b/sys/compat/sys/poll.h index 4eb19b2ea088..2d5af944baa9 100644 --- a/sys/compat/sys/poll.h +++ b/sys/compat/sys/poll.h @@ -46,6 +46,8 @@ int pollts(struct pollfd * __restrict, nfds_t, const struct timespec50 * __restrict, const sigset_t * __restrict); int __pollts50(struct pollfd * __restrict, nfds_t, const struct timespec * __restrict, const sigset_t * __restrict); +int ppoll(struct pollfd * __restrict, nfds_t, + const struct timespec * __restrict, const sigset_t * __restrict); __END_DECLS #endif /* _NETBSD_SOURCE */ diff --git a/sys/kern/sys_sig.c b/sys/kern/sys_sig.c index 7edd4c4606f9..8cbc24725c05 100644 --- a/sys/kern/sys_sig.c +++ b/sys/kern/sys_sig.c @@ -621,7 +621,7 @@ sigsuspendsetup(struct lwp *l, const sigset_t *ss) struct proc *p = l->l_proc; /* - * When returning from sigsuspend/pselect/pollts, we want + * When returning from sigsuspend/pselect/pollts/ppoll, we want * the old mask to be restored after the * signal handler has finished. Thus, we * save it here and mark the sigctx structure diff --git a/sys/rump/include/rump/rump_syscalls.h b/sys/rump/include/rump/rump_syscalls.h index af4702cc0fb7..fae265566762 100644 --- a/sys/rump/include/rump/rump_syscalls.h +++ b/sys/rump/include/rump/rump_syscalls.h @@ -999,7 +999,7 @@ ssize_t rump_sys_extattr_list_fd(int, int, void *, size_t) __RENAME(RUMP_SYS_REN ssize_t rump_sys_extattr_list_file(const char *, int, void *, size_t) __RENAME(RUMP_SYS_RENAME_EXTATTR_LIST_FILE); ssize_t rump_sys_extattr_list_link(const char *, int, void *, size_t) __RENAME(RUMP_SYS_RENAME_EXTATTR_LIST_LINK); int rump_sys_pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *) __RENAME(RUMP_SYS_RENAME_PSELECT); -int rump_sys_pollts(struct pollfd *, u_int, const struct timespec *, const sigset_t *) __RENAME(RUMP_SYS_RENAME_POLLTS); +int rump_sys_ppoll(struct pollfd *, u_int, const struct timespec *, const sigset_t *) __RENAME(RUMP_SYS_RENAME_PPOLL); int rump_sys_setxattr(const char *, const char *, const void *, size_t, int) __RENAME(RUMP_SYS_RENAME_SETXATTR); int rump_sys_lsetxattr(const char *, const char *, const void *, size_t, int) __RENAME(RUMP_SYS_RENAME_LSETXATTR); int rump_sys_fsetxattr(int, const char *, const void *, size_t, int) __RENAME(RUMP_SYS_RENAME_FSETXATTR); diff --git a/sys/sys/poll.h b/sys/sys/poll.h index 8267c008de1b..735f540dfebe 100644 --- a/sys/sys/poll.h +++ b/sys/sys/poll.h @@ -89,6 +89,8 @@ struct timespec; __BEGIN_DECLS #ifndef __LIBC12_SOURCE__ +int ppoll(struct pollfd * __restrict, nfds_t, + const struct timespec * __restrict, const sigset_t * __restrict); int pollts(struct pollfd * __restrict, nfds_t, const struct timespec * __restrict, const sigset_t * __restrict) __RENAME(__pollts50); diff --git a/tests/lib/libc/gen/t_sleep.c b/tests/lib/libc/gen/t_sleep.c index 4545a6941a76..0c81e7a65908 100644 --- a/tests/lib/libc/gen/t_sleep.c +++ b/tests/lib/libc/gen/t_sleep.c @@ -125,7 +125,7 @@ do_poll(struct timespec *delay, struct timespec *remain) struct timeval tv; TIMESPEC_TO_TIMEVAL(&tv, delay); - if (pollts(NULL, 0, delay, NULL) == -1) + if (ppoll(NULL, 0, delay, NULL) == -1) ret = (errno == EINTR ? 0 : errno); else ret = 0; diff --git a/tests/lib/libc/sys/t_poll.c b/tests/lib/libc/sys/t_poll.c index 7a786d2dd153..73d515f6a7c1 100644 --- a/tests/lib/libc/sys/t_poll.c +++ b/tests/lib/libc/sys/t_poll.c @@ -233,15 +233,15 @@ ATF_TC_BODY(poll_err, tc) ATF_REQUIRE_ERRNO(EINVAL, poll(&pfd, 1, -2) == -1); } -ATF_TC(pollts_basic); -ATF_TC_HEAD(pollts_basic, tc) +ATF_TC(ppoll_basic); +ATF_TC_HEAD(ppoll_basic, tc) { atf_tc_set_md_var(tc, "timeout", "10"); atf_tc_set_md_var(tc, "descr", - "Basis functionality test for pollts(2)"); + "Basis functionality test for ppoll(2)"); } -ATF_TC_BODY(pollts_basic, tc) +ATF_TC_BODY(ppoll_basic, tc) { int fds[2]; struct pollfd pfds[2]; @@ -265,7 +265,7 @@ ATF_TC_BODY(pollts_basic, tc) */ pfds[0].revents = -1; pfds[1].revents = -1; - ATF_REQUIRE_EQ_MSG(ret = pollts(&pfds[0], 1, &timeout, NULL), 0, + ATF_REQUIRE_EQ_MSG(ret = ppoll(&pfds[0], 1, &timeout, NULL), 0, "got: %d", ret); ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents); ATF_REQUIRE_EQ_MSG(pfds[1].revents, -1, "got: %d", pfds[1].revents); @@ -273,7 +273,7 @@ ATF_TC_BODY(pollts_basic, tc) /* Check that the write end of the pipe as reported as ready. */ pfds[0].revents = -1; pfds[1].revents = -1; - ATF_REQUIRE_EQ_MSG(ret = pollts(&pfds[1], 1, &timeout, NULL), 1, + ATF_REQUIRE_EQ_MSG(ret = ppoll(&pfds[1], 1, &timeout, NULL), 1, "got: %d", ret); ATF_REQUIRE_EQ_MSG(pfds[0].revents, -1, "got: %d", pfds[0].revents); ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d",\ @@ -282,7 +282,7 @@ ATF_TC_BODY(pollts_basic, tc) /* Check that only the write end of the pipe as reported as ready. */ pfds[0].revents = -1; pfds[1].revents = -1; - ATF_REQUIRE_EQ_MSG(ret = pollts(pfds, 2, &timeout, NULL), 1, + ATF_REQUIRE_EQ_MSG(ret = ppoll(pfds, 2, &timeout, NULL), 1, "got: %d", ret); ATF_REQUIRE_EQ_MSG(pfds[0].revents, 0, "got: %d", pfds[0].revents); ATF_REQUIRE_EQ_MSG(pfds[1].revents, POLLOUT, "got: %d", @@ -294,7 +294,7 @@ ATF_TC_BODY(pollts_basic, tc) /* Check that both ends of our pipe are reported as ready. */ pfds[0].revents = -1; pfds[1].revents = -1; - ATF_REQUIRE_EQ_MSG(ret = pollts(pfds, 2, &timeout, NULL), 2, + ATF_REQUIRE_EQ_MSG(ret = ppoll(pfds, 2, &timeout, NULL), 2, "got: %d", ret); ATF_REQUIRE_EQ_MSG(pfds[0].revents, POLLIN, "got: %d", pfds[0].revents); @@ -305,13 +305,13 @@ ATF_TC_BODY(pollts_basic, tc) ATF_REQUIRE_EQ(close(fds[1]), 0); } -ATF_TC(pollts_err); -ATF_TC_HEAD(pollts_err, tc) +ATF_TC(ppoll_err); +ATF_TC_HEAD(ppoll_err, tc) { - atf_tc_set_md_var(tc, "descr", "Check errors from pollts(2)"); + atf_tc_set_md_var(tc, "descr", "Check errors from ppoll(2)"); } -ATF_TC_BODY(pollts_err, tc) +ATF_TC_BODY(ppoll_err, tc) { struct timespec timeout; struct pollfd pfd; @@ -324,24 +324,24 @@ ATF_TC_BODY(pollts_err, tc) timeout.tv_nsec = 0; errno = 0; - ATF_REQUIRE_ERRNO(EFAULT, pollts((void *)-1, 1, &timeout, NULL) == -1); + ATF_REQUIRE_ERRNO(EFAULT, ppoll((void *)-1, 1, &timeout, NULL) == -1); timeout.tv_sec = -1; timeout.tv_nsec = -1; errno = 0; - ATF_REQUIRE_ERRNO(EINVAL, pollts(&pfd, 1, &timeout, NULL) == -1); + ATF_REQUIRE_ERRNO(EINVAL, ppoll(&pfd, 1, &timeout, NULL) == -1); } -ATF_TC(pollts_sigmask); -ATF_TC_HEAD(pollts_sigmask, tc) +ATF_TC(ppoll_sigmask); +ATF_TC_HEAD(ppoll_sigmask, tc) { atf_tc_set_md_var(tc, "timeout", "10"); atf_tc_set_md_var(tc, "descr", - "Check that pollts(2) restores the signal mask (PR kern/44986)"); + "Check that ppoll(2) restores the signal mask (PR kern/44986)"); } -ATF_TC_BODY(pollts_sigmask, tc) +ATF_TC_BODY(ppoll_sigmask, tc) { int fd; struct pollfd pfd; @@ -364,10 +364,10 @@ ATF_TC_BODY(pollts_sigmask, tc) ATF_REQUIRE_EQ(sigprocmask(SIG_UNBLOCK, &mask, NULL), 0); /* - * Check that pollts(2) immediately returns. We block *all* - * signals during pollts(2). + * Check that ppoll(2) immediately returns. We block *all* + * signals during ppoll(2). */ - ATF_REQUIRE_EQ_MSG(ret = pollts(&pfd, 1, &timeout, &mask), 1, + ATF_REQUIRE_EQ_MSG(ret = ppoll(&pfd, 1, &timeout, &mask), 1, "got: %d", ret); /* Check that signals are now longer blocked. */ @@ -384,9 +384,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, poll_3way); ATF_TP_ADD_TC(tp, poll_basic); ATF_TP_ADD_TC(tp, poll_err); - ATF_TP_ADD_TC(tp, pollts_basic); - ATF_TP_ADD_TC(tp, pollts_err); - ATF_TP_ADD_TC(tp, pollts_sigmask); + ATF_TP_ADD_TC(tp, ppoll_basic); + ATF_TP_ADD_TC(tp, ppoll_err); + ATF_TP_ADD_TC(tp, ppoll_sigmask); return atf_no_error(); } diff --git a/usr.sbin/makemandb/nostem.txt b/usr.sbin/makemandb/nostem.txt index 0da7f82d8c67..7a92cb2c8052 100644 --- a/usr.sbin/makemandb/nostem.txt +++ b/usr.sbin/makemandb/nostem.txt @@ -3036,6 +3036,7 @@ ppath ppb ppbus ppi +ppoll ppp pppd pppdump -- 2.26.2