/bionic/libc/private/ |
H A D | bionic_time_conversions.h | 40 __LIBC_HIDDEN__ bool timespec_from_timeval(timespec& ts, const timeval& tv); 41 __LIBC_HIDDEN__ void timespec_from_ms(timespec& ts, const int ms); 43 __LIBC_HIDDEN__ void timeval_from_timespec(timeval& tv, const timespec& ts); 45 __LIBC_HIDDEN__ void absolute_timespec_from_timespec(timespec& abs_ts, const timespec& ts, 50 static inline int check_timespec(const timespec* ts, bool null_allowed) { argument 51 if (null_allowed && ts == nullptr) { 56 if (ts->tv_nsec < 0 || ts->tv_nsec >= NS_PER_S) { 59 if (ts->tv_sec < 0) {
|
/bionic/libc/bionic/ |
H A D | bionic_time_conversions.cpp | 33 bool timespec_from_timeval(timespec& ts, const timeval& tv) { argument 35 ts.tv_sec = tv.tv_sec; 41 ts.tv_nsec = tv.tv_usec * 1000; 45 void timespec_from_ms(timespec& ts, const int ms) { argument 46 ts.tv_sec = ms / 1000; 47 ts.tv_nsec = (ms % 1000) * 1000000; 50 void timeval_from_timespec(timeval& tv, const timespec& ts) { argument 51 tv.tv_sec = ts.tv_sec; 52 tv.tv_usec = ts.tv_nsec / 1000; 55 void absolute_timespec_from_timespec(timespec& abs_ts, const timespec& ts, clockid_ argument [all...] |
H A D | clock.cpp | 37 timespec ts; local 38 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == -1) { 41 return (ts.tv_sec * CLOCKS_PER_SEC) + (ts.tv_nsec / (NS_PER_S / CLOCKS_PER_SEC));
|
H A D | utimes.cpp | 37 timespec ts[2]; local 40 if (!timespec_from_timeval(ts[0], tv[0]) || !timespec_from_timeval(ts[1], tv[1])) { 44 ts_ptr = ts;
|
H A D | clock_getcpuclockid.cpp | 43 timespec ts; local 44 if (clock_getres(result, &ts) == -1) {
|
H A D | poll.cpp | 41 timespec ts; local 44 timespec_from_ms(ts, ms); 45 ts_ptr = &ts; 50 int ppoll(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset_t* ss) { argument 53 if (ts != NULL) { 54 mutable_ts = *ts; 69 timespec ts; local 72 if (!timespec_from_timeval(ts, *tv)) { 76 ts_ptr = &ts; 80 timeval_from_timespec(*tv, ts); 85 pselect(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds, const timespec* ts, const sigset_t* ss) argument [all...] |
H A D | pthread_cond.cpp | 232 timespec ts; local 235 absolute_timespec_from_timespec(ts, *rel_timeout, CLOCK_MONOTONIC); 236 abs_timeout = &ts; 243 timespec ts; local 244 timespec_from_ms(ts, ms); 245 return pthread_cond_timedwait_relative_np(cond_interface, mutex, &ts);
|
H A D | posix_timers.cpp | 207 int timer_gettime(timer_t id, itimerspec* ts) { argument 208 return __timer_gettime(to_kernel_timer_id(id), ts); 216 int timer_settime(timer_t id, int flags, const itimerspec* ts, itimerspec* ots) { argument 218 return __timer_settime(timer->kernel_timer_id, flags, ts, ots);
|
H A D | getentropy_linux.c | 359 struct timespec ts; local 392 HX(clock_gettime(cl[ii], &ts) == -1, ts); local 401 ts.tv_sec = 0; 402 ts.tv_nsec = 1; 403 (void) nanosleep(&ts, NULL); 463 &ts)) == -1, ts); 465 cnt += (int)ts.tv_nsec;
|
H A D | libc_logging.cpp | 565 timespec ts; local 566 clock_gettime(__android_log_clockid(), &ts); local 568 realtime_ts.tv_sec = ts.tv_sec; 569 realtime_ts.tv_nsec = ts.tv_nsec; 608 timespec ts; local 609 clock_gettime(__android_log_clockid(), &ts); local 611 realtime_ts.tv_sec = ts.tv_sec; 612 realtime_ts.tv_nsec = ts.tv_nsec;
|
H A D | ndk_cruft.cpp | 104 char* strtotimeval(const char* str, struct timeval* ts) { argument 106 ts->tv_sec = strtoumax(str, &s, 10); 126 ts->tv_usec = fractional_seconds;
|
H A D | pthread_mutex.cpp | 616 timespec ts; local 617 timespec_from_ms(ts, ms); 619 absolute_timespec_from_timespec(abs_timeout, ts, CLOCK_MONOTONIC);
|
/bionic/libc/include/sys/ |
H A D | time.h | 80 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ 81 (ts)->tv_sec = (tv)->tv_sec; \ 82 (ts)->tv_nsec = (tv)->tv_usec * 1000; \ 84 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ 85 (tv)->tv_sec = (ts)->tv_sec; \ 86 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
|
/bionic/tests/ |
H A D | semaphore_test.cpp | 95 static inline void timespec_add_ms(timespec& ts, size_t ms) { argument 96 ts.tv_sec += ms / 1000; 97 ts.tv_nsec += (ms % 1000) * 1000000; 98 if (ts.tv_nsec >= NS_PER_S) { 99 ts.tv_sec++; 100 ts.tv_nsec -= NS_PER_S; 108 timespec ts; local 109 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); 110 timespec_add_ms(ts, 100); 113 ASSERT_EQ(-1, sem_timedwait(&s, &ts)); [all...] |
H A D | time_test.cpp | 197 itimerspec ts; local 198 ts.it_value.tv_sec = value_s; 199 ts.it_value.tv_nsec = value_ns; 200 ts.it_interval.tv_sec = interval_s; 201 ts.it_interval.tv_nsec = interval_ns; 202 ASSERT_EQ(0, timer_settime(t, 0, &ts, NULL)); 251 itimerspec ts; local 252 ts.it_value.tv_sec = 0; 253 ts.it_value.tv_nsec = 1; 254 ts 488 itimerspec ts; local 550 timespec ts; local 566 timespec ts; local [all...] |
H A D | sys_socket_test.cpp | 156 struct timespec ts; local 157 memset(&ts, 0, sizeof(ts)); 158 ts.tv_sec = 5; 159 ts.tv_nsec = 0; 161 static_cast<size_t>(recvmmsg(fd_acc, msgs, NUM_RECV_MSGS, 0, &ts)))
|
H A D | pthread_test.cpp | 465 timespec ts; local 466 ASSERT_EQ(0, clock_gettime(c, &ts)); 776 timespec ts; local 777 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); 778 ts.tv_sec += 1; 780 return pthread_rwlock_timedwrlock(lock, &ts); 812 timespec ts; local 813 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); 814 ts.tv_sec += 1; 816 return pthread_rwlock_timedrdlock(lock, &ts); 827 timespec ts; local 1194 timespec ts; local 1206 timespec ts; local 1222 timespec ts; local 1673 timespec ts; local [all...] |
/bionic/libc/kernel/uapi/linux/ |
H A D | errqueue.h | 44 struct timespec ts[3]; member in struct:scm_timestamping
|
H A D | ptp_clock.h | 65 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; member in struct:ptp_sys_offset
|
H A D | omap3isp.h | 106 struct timeval ts; member in struct:omap3isp_stat_data
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
H A D | res_random.c | 178 struct timespec ts; local 222 clock_gettime(CLOCK_MONOTONIC, &ts); 223 ru_reseed = ts.tv_sec + RU_OUT; 230 struct timespec ts; local 235 clock_gettime(CLOCK_MONOTONIC, &ts); 240 if (ru_counter >= RU_MAX || ts.tv_sec > ru_reseed || pid != ru_pid) {
|
/bionic/libc/upstream-netbsd/lib/libc/isc/ |
H A D | ev_timers.c | 168 struct timespec ts; local 170 ts.tv_sec = tv.tv_sec; 171 ts.tv_nsec = tv.tv_usec * 1000; 172 return (ts); 176 evTimeVal(struct timespec ts) { argument 179 tv.tv_sec = ts.tv_sec; 180 tv.tv_usec = (suseconds_t)(ts.tv_nsec / 1000);
|
/bionic/libc/tzcode/ |
H A D | localtime.c | 578 struct state *ts = &lsp->u.st; local 581 if (tzparse(&up->buf[1], ts, false) 582 && ts->typecnt == 2) { 588 AHDT YST AKDT AKST) and ts->charcnt equals 10 594 char *tsabbr = ts->chars + ts->ttis[i].tt_abbrind; 598 ts->ttis[i].tt_abbrind = j; 607 ts->ttis[i].tt_abbrind = j; 614 for (i = 0; i < ts->timecnt; i++) 615 if (sp->ats[sp->timecnt - 1] < ts [all...] |
/bionic/libc/dns/resolv/ |
H A D | res_cache.c | 1306 struct timespec ts = {0,0}; local 1308 ts.tv_sec = _time_now() + PENDING_REQUEST_TIMEOUT; 1309 pthread_cond_timedwait(&ri->cond, &_res_cache_list_lock, &ts);
|