search for: io_loop_get_wait_time

Displaying 6 results from an estimated 6 matches for "io_loop_get_wait_time".

2003 May 16
1
rawlog fails
You mentioned --with-rawlog earlier, so I tried it. It fails with a select error. I believe it's because in some cases the timeval struct is not initialized in io_loop_get_wait_time (e.g. see sample diff below). -mm- diff -c src/lib/ioloop.c.orig src/lib/ioloop.c *** src/lib/ioloop.c.orig Sat Apr 12 11:00:10 2003 --- src/lib/ioloop.c Thu May 15 22:10:12 2003 *************** *** 223,230 **** --- 223,238 ---- int io_loop_get_wait_time(struct timeout *timeout, str...
2018 Feb 13
1
dovecot: master: Panic: kevent() failed: Invalid argument
...the kevent() timespec values and got: Nov 29 16:46:27 mail dovecot: master: Panic: kevent(events=74, ts=59.1000000000) failed: Invalid argument Looking through the code, the panic is triggered in io_loop_handler_run_internal().? The timeout values for the kevent() call are obtained by calling io_loop_get_wait_time(), which in turn calls timeout_get_wait_time() (both in ioloop.c). The timeout is computed by subtracting the value returned by gettimeofday() from timeout->next_run, and it looks like in very rare cases the result in tv_r->tv_usec is 1000000uS (1 second). So, it seems that if gettimeofd...
2005 Dec 14
2
Patch: ioloop using kqueue/kevent for FreeBSD
..._handler_run(struct ioloop *ioloop) +{ + struct ioloop_handler_context *ctx = ioloop->handler_context; + struct timeval tv; + struct timespec ts; + unsigned int t_id; + int msecs, ret, i; + + /* get the time left for next timeout task */ + msecs = io_loop_get_wait_time(ioloop->timeouts, &tv, NULL); + ts.tv_sec = tv.tv_sec; + ts.tv_nsec = tv.tv_usec * 1000; + + /* wait for events */ + ret = kevent (ctx->kq, NULL, 0, ctx->evbuf, ctx->evbuf_size, &ts); + if (ret < 0 && errno != EINTR) +...
2004 Oct 25
0
[PATCH] Request for testing: BSD kqueue ioloop handler
...run(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data = ioloop->handler_data; + struct io_list *list; + struct kevent *event; + struct io *io; + struct timespec ts; + struct timeval tv; + unsigned int t_id; + int ret, i, call; + + /* get the time left for next timeout task */ + io_loop_get_wait_time(ioloop->timeouts, &tv, NULL); + TIMEVAL_TO_TIMESPEC(&tv, &ts); + + ret = kevent(data->kq, data->events, data->events_changed, + data->events, data->events_size, &ts); + + if (ret < 0 && errno != EINTR) + i_fatal("kevent(): %m"); + + data...
2004 Aug 30
0
[PATCH] [RFC] epoll based ioloop handler (now with patch)
...r_run(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data = ioloop->handler_data; + struct epoll_event *event; + struct io_list *list; + struct io *io; + struct timeval tv; + unsigned int t_id; + int msecs, ret, i, call; + + /* get the time left for next timeout task */ + msecs = io_loop_get_wait_time(ioloop->timeouts, &tv, NULL); + + ret = epoll_wait(data->epfd, data->events, data->events_size, msecs); + if (ret < 0 && errno != EINTR) + i_warning("epoll_wait() : %m"); + + /* execute timeout handlers */ + io_loop_handle_timeouts(ioloop); + + if (ret &...
2003 Apr 16
1
PATCH Add support for kqueue in ioloop subsystem
...run(struct ioloop *ioloop) { struct ioloop_handler_data *data = ioloop->handler_data; struct timeval tv; struct timespec ts; struct io *io, *next; struct kevent kes[KEVENT_SET_SIZE], *kev; unsigned int t_id; int ret, id, mark; /* get the time left for next timeout task */ io_loop_get_wait_time(ioloop->timeouts, &tv, NULL); /* convert struct timeval into struct timespec */ TIMEVAL_TO_TIMESPEC(&tv, &ts); /* zero the event vector */ memset(kes, 0, sizeof(struct kevent) * KEVENT_SET_SIZE); /* get any waiting kevents */ ret = kevent(data->kq, NULL, 0, kes, KEVENT_SE...