search for: fdrecord

Displaying 2 results from an estimated 2 matches for "fdrecord".

Did you mean: cdrecord
2005 Dec 14
2
Patch: ioloop using kqueue/kevent for FreeBSD
...sys/types.h> +#include <sys/event.h> +#include <sys/time.h> + +#ifndef INITIAL_BUF_SIZE +# define INITIAL_BUF_SIZE 128 +#endif + + +struct ioloop_handler_context { + int kq; + size_t evbuf_size; + struct kevent *evbuf; + + size_t fds_size; + struct fdrecord *fds; +}; + +struct fdrecord { + /* IO_READ | IO_WRITE | IO_ERROR */ + unsigned char mode : 3; +}; + + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_context *ctx; + + ioloop->handler_context = ctx = + p_new(ioloop->pool...
2005 Dec 15
2
Patch: More of kqueue() support.
...@@ void io_loop_handle_add(struct ioloop *i void io_loop_handle_remove(struct ioloop *ioloop, struct io *io) { struct ioloop_handler_context *ctx = ioloop->handler_context; + const int fd = io->fd; struct kevent ev = { fd, 0, EV_DELETE, 0, 0, NULL }; struct fdrecord *const fds = ctx->fds; - const int fd = io->fd; - const enum io_condition condition = io->condition; + const enum io_condition condition = io->condition & MASK; i_assert((size_t)fd < ctx->fds_size); i_assert(fds[fd].mode != 0); @@ -160,...