ioloop-epoll.c revision f2767c736d72e6aa9a2aae5d0a9b89abae9e29e9
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen/* Copyright (c) 2004-2013 Dovecot authors, see the included COPYING file */
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenvoid io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count)
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen ioloop->handler_context = ctx = i_new(struct ioloop_handler_context, 1);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen i_array_init(&ctx->fd_index, initial_fd_count);
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen i_fatal("epoll_create(): %m (you may need to increase "
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainenvoid io_loop_handler_deinit(struct ioloop *ioloop)
23878bd03d1de531e3261a25598beec621351910Timo Sirainen struct ioloop_handler_context *ctx = ioloop->handler_context;
23878bd03d1de531e3261a25598beec621351910Timo Sirainen unsigned int i, count;
23878bd03d1de531e3261a25598beec621351910Timo Sirainen list = array_get_modifiable(&ctx->fd_index, &count);
23878bd03d1de531e3261a25598beec621351910Timo Sirainen for (i = 0; i < count; i++)
23878bd03d1de531e3261a25598beec621351910Timo Sirainen array_free(&ioloop->handler_context->fd_index);
int events = 0, i;
for (i = 0; i < IOLOOP_IOLIST_IOS_PER_FD; i++) {
return events;
int op;
bool first;
if (first) {
int op;
bool last;
if (!closed) {
if (last) {
unsigned int events_count;
bool call;
if (events_count > 0) {
ret = 0;
for (i = 0; i < ret; i++) {
for (j = 0; j < IOLOOP_IOLIST_IOS_PER_FD; j++) {
if (call)