mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-23 11:49:50 +00:00
MFC from trunk
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/branches/trunk-merge@583 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
parent
30e4483aa8
commit
ceb202e9f0
@ -21,33 +21,30 @@
|
||||
const struct filter evfilt_proc = EVFILT_NOTIMPL;
|
||||
|
||||
int
|
||||
kevent_wait(struct kqueue *kq, const struct timespec *timeout)
|
||||
posix_kevent_wait(
|
||||
struct kqueue *kq,
|
||||
const struct timespec *timeout)
|
||||
{
|
||||
int n, nfds;
|
||||
fd_set rfds;
|
||||
|
||||
nfds = kq->kq_nfds;
|
||||
rfds = kq->kq_fds;
|
||||
int n;
|
||||
|
||||
dbg_puts("waiting for events");
|
||||
kqueue_unlock(kq);
|
||||
|
||||
n = pselect(nfds, &rfds, NULL , NULL, timeout, NULL);
|
||||
|
||||
kq->kq_rfds = kq->kq_fds;
|
||||
n = pselect(kq->kq_nfds, &kq->kq_rfds, NULL , NULL, timeout, NULL);
|
||||
if (n < 0) {
|
||||
if (errno == EINTR) {
|
||||
dbg_puts("signal caught");
|
||||
return (-1);
|
||||
}
|
||||
dbg_perror("pselect(2)");
|
||||
if (errno == EINTR)
|
||||
n = -EINTR;
|
||||
return (-1);
|
||||
}
|
||||
kqueue_lock(kq);
|
||||
|
||||
kq->kq_rfds = rfds;
|
||||
|
||||
return (n);
|
||||
}
|
||||
|
||||
#if FIXME
|
||||
int
|
||||
kevent_copyout(struct kqueue *kq, int nready,
|
||||
posix_kevent_copyout(struct kqueue *kq, int nready,
|
||||
struct kevent *eventlist, int nevents)
|
||||
{
|
||||
struct filter *filt;
|
||||
@ -75,3 +72,4 @@ kevent_copyout(struct kqueue *kq, int nready,
|
||||
|
||||
return (nret);
|
||||
}
|
||||
#endif
|
||||
|
@ -28,24 +28,6 @@
|
||||
|
||||
#include "private.h"
|
||||
|
||||
int
|
||||
evfilt_user_init(struct filter *filt)
|
||||
{
|
||||
if (kqops.eventfd_init(&filt->kf_efd) < 0)
|
||||
return (-1);
|
||||
|
||||
filt->kf_pfd = kqops.eventfd_descriptor(&filt->kf_efd);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
evfilt_user_destroy(struct filter *filt)
|
||||
{
|
||||
kqops.eventfd_close(&filt->kf_efd);
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
evfilt_user_copyout(struct filter *filt,
|
||||
struct kevent *dst,
|
||||
@ -166,8 +148,8 @@ evfilt_user_knote_disable(struct filter *filt, struct knote *kn)
|
||||
|
||||
const struct filter evfilt_user = {
|
||||
EVFILT_USER,
|
||||
evfilt_user_init,
|
||||
evfilt_user_destroy,
|
||||
NULL,
|
||||
NULL,
|
||||
evfilt_user_copyout,
|
||||
evfilt_user_knote_create,
|
||||
evfilt_user_knote_modify,
|
||||
|
Loading…
Reference in New Issue
Block a user