Displaying 3 results from an estimated 3 matches for "timeval_to_timespec".
2003 Mar 17
3
nanosleep() replacement
...y (&ttmp, NULL);
+ ttmp.tv_sec -= tsave.tv_sec;
+ ttmp.tv_usec -= tsave.tv_usec;
+ tsave.tv_sec = (time2wait.tv_sec - ttmp.tv_sec);
+ tsave.tv_usec = (time2wait.tv_usec - ttmp.tv_usec);
+ if(tsave.tv_sec < 0){
+ tsave.tv_sec = 0;
+ tsave.tv_usec += 1000000L;
+ }
+ rc = -1;
+ }
+
+ TIMEVAL_TO_TIMESPEC(&tsave, rem)
+
+ return(rc);
+}
+
+#endif
+
--- openssh/openbsd-compat/bsd-misc.h.old 2002-06-20 20:35:30.000000000 -0700
+++ openssh/openbsd-compat/bsd-misc.h 2003-03-16 15:32:29.850560003 -0800
@@ -80,5 +80,14 @@
int setgroups(size_t size, const gid_t *list);
#endif
+#if !defined(HAVE_NAN...
2004 Oct 25
0
[PATCH] Request for testing: BSD kqueue ioloop handler
...ata = 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->events_changed = 0;
+
+ /* execute timeout handlers */...
2003 Apr 16
1
PATCH Add support for kqueue in ioloop subsystem
...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_SET_SIZE, &ts);
if (ret < 0 && errno != EINTR)
i_warning("kevent processing failed: %m&qu...