ioloop-poll.c revision ead543115fe206aa3071317a367cbfad51644f41
/* Copyright (c) 2002-2003 Timo Sirainen */
/* @UNSAFE: whole file */
#include "lib.h"
#include "ioloop-internal.h"
#ifdef IOLOOP_POLL
#ifndef INITIAL_POLL_FDS
# define INITIAL_POLL_FDS 128
#endif
struct ioloop_handler_context {
unsigned int idx_count;
int *fd_index;
};
{
struct ioloop_handler_context *ctx;
}
{
}
{
unsigned int old_count;
/* grow the fd -> index array */
sizeof(int) * old_count,
}
/* grow the fd array */
}
/* update existing pollfd */
} else {
/* add new pollfd */
}
}
{
}
}
/* remove the whole pollfd */
return; /* removing last one */
/* move the last pollfd over the removed one */
}
}
{
unsigned int t_id;
/* get the time left for next timeout task */
i_fatal("poll(): %m");
/* execute timeout handlers */
/* no I/O events */
return;
}
i_error("invalid I/O fd %d, callback %p",
} else {
}
ret--;
if (call) {
i_panic("Leaked a t_pop() call in "
"I/O handler %p",
}
}
}
}
}
#endif