diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-17 22:56:41 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-17 22:56:41 -0800 |
| commit | 6c949de1cb46182303a85864bad753c12142fa97 (patch) | |
| tree | 9b66786e0a22d4d38089d8c269d6e096ef0a8617 /src/platform/posix/posix_pollq_kqueue.c | |
| parent | d83f5aea789f896c90208567a9e56599a439e90a (diff) | |
| download | nng-6c949de1cb46182303a85864bad753c12142fa97.tar.gz nng-6c949de1cb46182303a85864bad753c12142fa97.tar.bz2 nng-6c949de1cb46182303a85864bad753c12142fa97.zip | |
POSIX poller: add support for select, and for choosing the poller
Some platforms or configurations may not have more modern options
like kqueue or epoll, or may be constrained by policy.
Diffstat (limited to 'src/platform/posix/posix_pollq_kqueue.c')
| -rw-r--r-- | src/platform/posix/posix_pollq_kqueue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platform/posix/posix_pollq_kqueue.c b/src/platform/posix/posix_pollq_kqueue.c index ae1b2f47..562c888e 100644 --- a/src/platform/posix/posix_pollq_kqueue.c +++ b/src/platform/posix/posix_pollq_kqueue.c @@ -198,10 +198,10 @@ nni_posix_pfd_arm(nni_posix_pfd *pf, unsigned events) return (0); } - if (events & POLLIN) { + if (events & NNI_POLL_IN) { EV_SET(&ev[nev++], pf->fd, EVFILT_READ, flags, 0, 0, pf); } - if (events & POLLOUT) { + if (events & NNI_POLL_OUT) { EV_SET(&ev[nev++], pf->fd, EVFILT_WRITE, flags, 0, 0, pf); } while (kevent(pq->kq, ev, nev, NULL, 0, NULL) != 0) { @@ -254,10 +254,10 @@ nni_posix_poll_thr(void *arg) switch (ev->filter) { case EVFILT_READ: - revents = POLLIN; + revents = NNI_POLL_IN; break; case EVFILT_WRITE: - revents = POLLOUT; + revents = NNI_POLL_OUT; break; } if (ev->udata == NULL) { @@ -267,7 +267,7 @@ nni_posix_poll_thr(void *arg) } pf = (void *) ev->udata; if (ev->flags & EV_ERROR) { - revents |= POLLHUP; + revents |= NNI_POLL_HUP; } nni_mtx_lock(&pf->mtx); |
