Go to the source code of this file.
◆ EPOLLRDHUP
#define EPOLLRDHUP 0x2000 |
FIXME: uClibc < 0.9.30.3 does not define EPOLLRDHUP for Linux >= 2.6.17
Definition at line 23 of file uloop-epoll.c.
◆ __uloop_fd_delete()
static int __uloop_fd_delete |
( |
struct uloop_fd * |
sock | ) |
|
|
static |
◆ dispatch_timer()
static void dispatch_timer |
( |
struct uloop_fd * |
u, |
|
|
unsigned int |
events |
|
) |
| |
|
static |
Definition at line 108 of file uloop-epoll.c.
115 if (read(u->
fd, &fired,
sizeof(fired)) !=
sizeof(fired))
#define container_of(ptr, type, member)
union uloop_interval::@15 priv
uloop_interval_handler cb
static struct epoll_event events[ULOOP_MAX_EVENTS]
◆ register_poll()
static int register_poll |
( |
struct uloop_fd * |
fd, |
|
|
unsigned int |
flags |
|
) |
| |
|
static |
Definition at line 39 of file uloop-epoll.c.
41 struct epoll_event ev;
42 int op =
fd->registered ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
44 memset(&ev, 0,
sizeof(
struct epoll_event));
50 ev.events |= EPOLLOUT;
57 return epoll_ctl(
poll_fd, op,
fd->fd, &ev);
#define ULOOP_EDGE_TRIGGER
◆ timer_next()
Definition at line 175 of file uloop-epoll.c.
177 struct itimerspec spec;
182 if (timerfd_gettime(tm->
priv.
ufd.
fd, &spec) == -1)
185 return spec.it_value.tv_sec * 1000 + spec.it_value.tv_nsec / 1000000;
◆ timer_register()
static int timer_register |
( |
struct uloop_interval * |
tm, |
|
|
unsigned int |
msecs |
|
) |
| |
|
static |
Definition at line 124 of file uloop-epoll.c.
127 int fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK);
136 struct itimerspec spec = {
138 .tv_sec = msecs / 1000,
139 .tv_nsec = (msecs % 1000) * 1000000
142 .tv_sec = msecs / 1000,
143 .tv_nsec = (msecs % 1000) * 1000000
147 if (timerfd_settime(tm->
priv.
ufd.
fd, 0, &spec, NULL) == -1)
static void dispatch_timer(struct uloop_fd *u, unsigned int events)
int uloop_fd_add(struct uloop_fd *sock, unsigned int flags)
int uloop_fd_delete(struct uloop_fd *fd)
◆ timer_remove()
Definition at line 163 of file uloop-epoll.c.
static int __uloop_fd_delete(struct uloop_fd *sock)
◆ uloop_fetch_events()
static int uloop_fetch_events |
( |
int |
timeout | ) |
|
|
static |
Definition at line 68 of file uloop-epoll.c.
73 for (n = 0; n < nfds; ++n) {
static struct uloop_fd_event cur_fds[10]
◆ uloop_init_pollfd()
static int uloop_init_pollfd |
( |
void |
| ) |
|
|
static |
◆ events