search for: io_loop_handler_init

Displaying 9 results from an estimated 9 matches for "io_loop_handler_init".

Did you mean: io_loop_handler_deinit
2004 Aug 25
0
[PATCH] move highest_fd calculations to ioloop-select.c
...if (io->fd == current_ioloop->highest_fd) - update_highest_fd(current_ioloop); - io->fd = -1; } @@ -275,7 +248,6 @@ struct ioloop *io_loop_create(pool_t poo ioloop = p_new(pool, struct ioloop, 1); pool_ref(pool); ioloop->pool = pool; - ioloop->highest_fd = -1; io_loop_handler_init(ioloop); diff -urpNX /usr/share/dontdiff -x Makefile dovecot-1.0-test35.vanilla/src/lib/ioloop-select.c dovecot-1.0-test35/src/lib/ioloop-select.c --- dovecot-1.0-test35.vanilla/src/lib/ioloop-select.c 2004-08-23 17:46:41.000000000 +0400 +++ dovecot-1.0-test35/src/lib/ioloop-select.c 2004-08-25 1...
2005 Dec 14
2
Patch: ioloop using kqueue/kevent for FreeBSD
...28 +#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, struct ioloop_handler_context, 1); + ctx->evbuf_size = INITIAL_BUF_SIZE; + ctx->evbuf = p_new(ioloop->pool, struct keve...
2004 Oct 07
0
[PATCH] add missing error check in epoll code
...are/dontdiff dovecot-1.0-test46.vanilla/src/lib/ioloop-epoll.c dovecot-1.0-test46/src/lib/ioloop-epoll.c --- dovecot-1.0-test46.vanilla/src/lib/ioloop-epoll.c 2004-09-06 00:59:47.000000000 +0400 +++ dovecot-1.0-test46/src/lib/ioloop-epoll.c 2004-10-05 21:39:52.000000000 +0400 @@ -57,6 +47,8 @@ void io_loop_handler_init(struct ioloop data->fd_index = p_new(ioloop->pool, struct io_list *, data->idx_size); data->epfd = epoll_create(INITIAL_EPOLL_EVENTS); + if (data->epfd < 0) + i_panic("epoll_create(): %m"); } void io_loop_handler_deinit(struct ioloop *ioloop) -------------- n...
2004 Oct 25
0
[PATCH] move iolist functions into separate file
...-enum { - EPOLL_LIST_INPUT, - EPOLL_LIST_OUTPUT, - - EPOLL_IOS_PER_FD -}; - struct ioloop_handler_data { int epfd; int events_size, events_pos; @@ -37,10 +31,6 @@ struct ioloop_handler_data { struct io_list **fd_index; }; -struct io_list { - struct io *ios[EPOLL_IOS_PER_FD]; -}; - void io_loop_handler_init(struct ioloop *ioloop) { struct ioloop_handler_data *data; @@ -74,58 +64,6 @@ void io_loop_handler_deinit(struct ioloo #define IO_EPOLL_INPUT (EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP) #define IO_EPOLL_OUTPUT (EPOLLOUT | EPOLLERR | EPOLLHUP) -static int epoll_event_mask(struct io_list *list)...
2004 Aug 23
1
[PATCH] pass struct io * to io_loop_handle_add()/io_loop_handle_remove()
...struct ioloop *ioloop, int fd, - enum io_condition condition); -void io_loop_handle_remove(struct ioloop *ioloop, int fd, - enum io_condition condition); +void io_loop_handle_add(struct ioloop *ioloop, struct io *io); +void io_loop_handle_remove(struct ioloop *ioloop, struct io *io); void io_loop_handler_init(struct ioloop *ioloop); void io_loop_handler_deinit(struct ioloop *ioloop); diff -urpNX /usr/share/dontdiff dovecot-1.0-test32.vanilla/src/lib/ioloop-poll.c dovecot-1.0-test32/src/lib/ioloop-poll.c --- dovecot-1.0-test32.vanilla/src/lib/ioloop-poll.c 2003-08-27 01:18:16.000000000 +0400 +++ dovecot...
2004 Oct 25
0
[PATCH] Request for testing: BSD kqueue ioloop handler
....h> +#include <sys/time.h> +#include <unistd.h> + +#define INITIAL_KQUEUE_EVENTS 128 + +struct ioloop_handler_data { + int kq; + + unsigned int events_size, events_pos, events_changed; + struct kevent *events; + + unsigned int idx_size; + struct io_list **fd_index; +}; + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data; + + ioloop->handler_data = data = + p_new(ioloop->pool, struct ioloop_handler_data, 1); + + data->events_pos = 0; + data->events_changed = 0; + data->events_size = INITIAL_KQUEUE_EVENTS; + data->events = p_new(ioloop-&...
2004 Aug 30
0
[PATCH] [RFC] epoll based ioloop handler (now with patch)
...INITIAL_EPOLL_EVENTS 128 +#define EPOLL_IOS_PER_FD 2 + +struct ioloop_handler_data { + int epfd; + int events_size, events_pos; + struct epoll_event *events; + + unsigned int idx_size; + struct io_list **fd_index; +}; + +struct io_list { + int count; + struct io *ios[EPOLL_IOS_PER_FD]; +}; + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data; + + ioloop->handler_data = data = + p_new(ioloop->pool, struct ioloop_handler_data, 1); + + data->events_pos = 0; + data->events_size = INITIAL_EPOLL_EVENTS; + data->events = p_new(ioloop->pool, struct epoll_event, +...
2003 Apr 16
1
PATCH Add support for kqueue in ioloop subsystem
...IOLOOP_KEVENT #include <sys/time.h> #include <sys/types.h> #include <sys/event.h> #ifndef KEVENT_SET_SIZE # define KEVENT_SET_SIZE 16 #endif struct ioloop_handler_data { int kq; /* kqueue descriptor */ struct kevent event; /* a kevent struct which we pass around */ }; void io_loop_handler_init(struct ioloop *ioloop) { struct ioloop_handler_data *data; ioloop->handler_data = data = p_new(ioloop->pool, struct ioloop_handler_data, 1); data->kq = kqueue(); if (data->kq < 0) { i_fatal("couldn't initialise kqueue: %m"); } memset(&data->event, 0,...
2005 Dec 15
2
Patch: More of kqueue() support.
...; #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> @@ -24,6 +25,8 @@ # define INITIAL_BUF_SIZE 128 #endif +#define MASK (IO_READ | IO_WRITE | IO_ERROR) + struct ioloop_handler_context { int kq; size_t evbuf_size; @@ -57,6 +60,7 @@ void io_loop_handler_init(struct ioloop void io_loop_handler_deinit(struct ioloop *ioloop) { + close(ioloop->handler_context->kq); p_free(ioloop->pool, ioloop->handler_context->evbuf); p_free(ioloop->pool, ioloop->handler_context->fds); p_free(ioloop->pool, i...