Lines Matching +full:tv +full:- +full:set

3 /*-
34 #include <atf-c.h>
46 #define BILLION 1000000000LL /* nano-seconds per second */
47 #define MILLION 1000000LL /* nano-seconds per milli-second */
51 #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */
52 #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */
58 * starts at 1sec (since it cannot handle sub-second intervals).
66 * The ALARM is only set if the current pass's delay is longer, and
69 * The 'kevent' test needs the ALARM to be set on a different pass
70 * from when the KEVNT_TIMEOUT fires. So set ALARM to fire on the
72 * set KEVNT_TIMEOUT just barely long enough to put it into the
73 * last test pass, and set MAXSLEEP a couple seconds longer than
102 if (nanosleep(delay, remain) == -1) in do_nanosleep()
113 struct timeval tv; in do_select() local
115 TIMESPEC_TO_TIMEVAL(&tv, delay); in do_select()
116 if (select(0, NULL, NULL, NULL, &tv) == -1) in do_select()
128 struct timeval tv; in do_poll() local
130 TIMESPEC_TO_TIMEVAL(&tv, delay); in do_poll()
131 if (pollts(NULL, 0, delay, NULL) == -1) in do_poll()
142 struct timeval tv; in do_sleep() local
144 TIMESPEC_TO_TIMEVAL(&tv, delay); in do_sleep()
145 remain->tv_sec = sleep(delay->tv_sec); in do_sleep()
146 remain->tv_nsec = 0; in do_sleep()
159 ATF_REQUIRE_MSG((kq = kqueue()) != -1, "kqueue: %s", strerror(errno)); in do_kevent()
169 tmo/1000 < delay->tv_sec && tmo/500 > delay->tv_sec) in do_kevent()
170 delay->tv_sec = MAXSLEEP; in do_kevent()
179 if (rtc == -1) { in do_kevent()
185 if (delay->tv_sec * BILLION + delay->tv_nsec > tmo * MILLION) in do_kevent()
301 delta1 = (int64_t)tsb.tv_sec - (int64_t)tsa.tv_sec; in sleeptest()
303 delta1 += (int64_t)tsb.tv_nsec - (int64_t)tsa.tv_nsec; in sleeptest()
309 delta3 += (int64_t)tslp.tv_nsec - delta1 - delta2; in sleeptest()
314 if (delta3 > FUZZ || delta3 < -FUZZ) { in sleeptest()