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:
mheily 2012-10-28 21:51:19 +00:00
parent 30e4483aa8
commit ceb202e9f0
2 changed files with 16 additions and 36 deletions

View File

@ -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

View File

@ -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,