/time/ |
A D | tst-clock.c | 32 struct timespec ts; in clock_test() local 37 memset (&ts, '\0', sizeof ts); in clock_test() 43 if (clock_getres (cl, &ts) == 0) in clock_test() 45 if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000) in clock_test() 52 cl, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec); in clock_test() 60 memset (&ts, '\0', sizeof ts); in clock_test() 66 if (clock_gettime (cl, &ts) == 0) in clock_test() 68 if (ts.tv_nsec < 0 || ts.tv_nsec >= 1000000000) in clock_test() 77 cl, (intmax_t) ts.tv_sec, (intmax_t) ts.tv_nsec); in clock_test() 79 if (memcmp (&ts, &old_ts, sizeof ts) == 0) in clock_test() [all …]
|
A D | tst-timespec_getres.c | 26 struct timespec ts; in do_test() local 27 TEST_COMPARE (timespec_getres (&ts, 0), 0); in do_test() 32 struct timespec ts; in do_test() local 33 TEST_COMPARE (timespec_getres (&ts, TIME_UTC), TIME_UTC); in do_test() 36 TEST_VERIFY (ts.tv_sec == 0); in do_test() 37 TEST_VERIFY (ts.tv_nsec > 0); in do_test() 38 TEST_VERIFY (ts.tv_nsec < 1000000000); in do_test() 44 TEST_COMPARE (ts.tv_sec, cts.tv_sec); in do_test() 45 TEST_COMPARE (ts.tv_nsec, cts.tv_nsec); in do_test()
|
A D | tst-timespec_get.c | 26 struct timespec ts; in do_test() local 27 TEST_COMPARE (timespec_get (&ts, 0), 0); in do_test() 31 struct timespec ts; in do_test() local 32 TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC); in do_test() 33 TEST_VERIFY (ts.tv_nsec >= 0); in do_test() 34 TEST_VERIFY (ts.tv_nsec < 1000000000); in do_test()
|
A D | time.c | 25 struct timespec ts; in time() local 26 __clock_gettime (TIME_CLOCK_GETTIME_CLOCKID, &ts); in time() 29 *timer = ts.tv_sec; in time() 30 return ts.tv_sec; in time()
|
A D | ftime.c | 25 struct timespec ts; in ftime() local 26 __clock_gettime (CLOCK_REALTIME, &ts); in ftime() 28 timebuf->time = ts.tv_sec; in ftime() 29 timebuf->millitm = ts.tv_nsec / 1000000; in ftime()
|
A D | stime.c | 30 struct timespec ts; in __stime() local 31 ts.tv_sec = *when; in __stime() 32 ts.tv_nsec = 0; in __stime() 34 return __clock_settime (CLOCK_REALTIME, &ts); in __stime()
|
A D | tst-clock_nanosleep.c | 35 struct timespec ts = { 1, 0 }; in clock_nanosleep_test() local 36 TEMP_FAILURE_RETRY (clock_nanosleep (CLOCK_REALTIME, 0, &ts, &ts)); in clock_nanosleep_test() 54 struct timespec ts = { TYPE_MAXIMUM (time_t), 0 }; in clock_nanosleep_large_timeout() local 55 int r = clock_nanosleep (CLOCK_REALTIME, 0, &ts, NULL); in clock_nanosleep_large_timeout()
|
A D | tst-clock2.c | 17 struct timespec ts; in do_test() local 18 if (clock_gettime (CLOCK_MONOTONIC, &ts) != 0) in do_test() 25 if (clock_settime (CLOCK_MONOTONIC, &ts) != -1) in do_test()
|
A D | gettimeofday.c | 31 struct timespec ts; in ___gettimeofday() local 32 if (__clock_gettime (CLOCK_REALTIME, &ts)) in ___gettimeofday() 35 TIMESPEC_TO_TIMEVAL (tv, &ts); in ___gettimeofday()
|
A D | settimeofday.c | 37 struct timespec ts; in __settimeofday() local 38 TIMEVAL_TO_TIMESPEC (tv, &ts); in __settimeofday() 39 return __clock_settime (CLOCK_REALTIME, &ts); in __settimeofday()
|
A D | timespec_get.c | 23 timespec_get (struct timespec *ts, int base) in timespec_get() argument 27 __clock_gettime (CLOCK_REALTIME, ts); in timespec_get()
|
A D | timespec_getres.c | 24 timespec_getres (struct timespec *ts, int base) in timespec_getres() argument 28 __clock_getres (CLOCK_REALTIME, ts); in timespec_getres()
|
A D | tst-itimer.c | 41 struct timespec ts = { .tv_sec = sec, .tv_nsec = 0 }; in intr_sleep() local 42 while (nanosleep (&ts, &ts) == -1 && errno == EINTR) in intr_sleep()
|
/time/sys/ |
A D | time.h | 38 # define TIMEVAL_TO_TIMESPEC(tv, ts) { \ argument 39 (ts)->tv_sec = (tv)->tv_sec; \ 40 (ts)->tv_nsec = (tv)->tv_usec * 1000; \ 42 # define TIMESPEC_TO_TIMEVAL(tv, ts) { \ argument 43 (tv)->tv_sec = (ts)->tv_sec; \ 44 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
|