1 #ifndef __LUNAIX_IOPOLL_H
2 #define __LUNAIX_IOPOLL_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/llist.h>
8 #include <usr/lunaix/poll.h>
10 typedef struct llist_header poll_evt_q;
14 struct pollfd** upoll;
21 poll_evt_q evt_listener;
22 struct v_file* file_ref;
28 struct iopoller** pollers;
33 iopoll_listen_on(struct iopoller* listener, poll_evt_q* source)
35 llist_append(source, &listener->evt_listener);
39 iopoll_wake_pollers(poll_evt_q*);
42 iopoll_init(struct iopoll*);
45 iopoll_free(pid_t, struct iopoll*);
48 iopoll_install(pid_t, struct iopoll*, struct v_fd*);
51 iopoll_remove(pid_t, struct iopoll*, int);
54 poll_setrevt(struct poll_info* pinfo, int evt)
56 pinfo->revents = (pinfo->revents & ~evt) | evt;
60 poll_checkevt(struct poll_info* pinfo, int evt)
62 return pinfo->events & evt;
65 #endif /* __LUNAIX_POLL_H */