/bionic/libc/bionic/ |
D | bionic_time_conversions.cpp | 33 bool timespec_from_timeval(timespec& ts, const timeval& tv) { in timespec_from_timeval() argument 35 ts.tv_sec = tv.tv_sec; in timespec_from_timeval() 41 ts.tv_nsec = tv.tv_usec * 1000; in timespec_from_timeval() 45 void timespec_from_ms(timespec& ts, const int ms) { in timespec_from_ms() argument 46 ts.tv_sec = ms / 1000; in timespec_from_ms() 47 ts.tv_nsec = (ms % 1000) * 1000000; in timespec_from_ms() 50 void timeval_from_timespec(timeval& tv, const timespec& ts) { in timeval_from_timespec() argument 51 tv.tv_sec = ts.tv_sec; in timeval_from_timespec() 52 tv.tv_usec = ts.tv_nsec / 1000; in timeval_from_timespec() 57 bool timespec_from_absolute_timespec(timespec& ts, const timespec& abs_ts, clockid_t clock) { in timespec_from_absolute_timespec() argument [all …]
|
D | poll.cpp | 41 timespec ts; in poll() local 44 timespec_from_ms(ts, ms); in poll() 45 ts_ptr = &ts; in poll() 50 int ppoll(pollfd* fds, nfds_t fd_count, const timespec* ts, const sigset_t* ss) { in ppoll() argument 53 if (ts != NULL) { in ppoll() 54 mutable_ts = *ts; in ppoll() 69 timespec ts; in select() local 72 if (!timespec_from_timeval(ts, *tv)) { in select() 76 ts_ptr = &ts; in select() 80 timeval_from_timespec(*tv, ts); in select() [all …]
|
D | clock.cpp | 37 timespec ts; in clock() local 38 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == -1) { in clock() 41 return (ts.tv_sec * CLOCKS_PER_SEC) + (ts.tv_nsec / (NS_PER_S / CLOCKS_PER_SEC)); in clock()
|
D | utimes.cpp | 37 timespec ts[2]; in utimes() local 40 if (!timespec_from_timeval(ts[0], tv[0]) || !timespec_from_timeval(ts[1], tv[1])) { in utimes() 44 ts_ptr = ts; in utimes()
|
D | clock_getcpuclockid.cpp | 43 timespec ts; in clock_getcpuclockid() local 44 if (clock_getres(result, &ts) == -1) { in clock_getcpuclockid()
|
D | pthread_cond.cpp | 189 timespec ts; in __pthread_cond_timedwait() local 193 rel_timeout = &ts; in __pthread_cond_timedwait() 247 timespec ts; in pthread_cond_timeout_np() local 248 timespec_from_ms(ts, ms); in pthread_cond_timeout_np() 249 return pthread_cond_timedwait_relative_np(cond_interface, mutex, &ts); in pthread_cond_timeout_np()
|
D | posix_timers.cpp | 207 int timer_gettime(timer_t id, itimerspec* ts) { in timer_gettime() argument 208 return __timer_gettime(to_kernel_timer_id(id), ts); in timer_gettime() 216 int timer_settime(timer_t id, int flags, const itimerspec* ts, itimerspec* ots) { in timer_settime() argument 218 return __timer_settime(timer->kernel_timer_id, flags, ts, ots); in timer_settime()
|
D | getentropy_linux.c | 359 struct timespec ts; in getentropy_fallback() local 392 HX(clock_gettime(cl[ii], &ts) == -1, ts); in getentropy_fallback() 401 ts.tv_sec = 0; in getentropy_fallback() 402 ts.tv_nsec = 1; in getentropy_fallback() 403 (void) nanosleep(&ts, NULL); in getentropy_fallback() 463 &ts)) == -1, ts); in getentropy_fallback() 465 cnt += (int)ts.tv_nsec; in getentropy_fallback()
|
D | semaphore.cpp | 247 timespec ts; in sem_timedwait() local 248 if (!timespec_from_absolute_timespec(ts, *abs_timeout, CLOCK_REALTIME)) { in sem_timedwait() 259 int ret = __futex_wait_ex(sem_count_ptr, shared, shared | SEMCOUNT_MINUS_ONE, &ts); in sem_timedwait()
|
D | libc_logging.cpp | 506 timespec ts; in __libc_write_log() local 507 clock_gettime(CLOCK_REALTIME, &ts); in __libc_write_log() 509 realtime_ts.tv_sec = ts.tv_sec; in __libc_write_log() 510 realtime_ts.tv_nsec = ts.tv_nsec; in __libc_write_log() 568 timespec ts; in __libc_android_log_event() local 569 clock_gettime(CLOCK_REALTIME, &ts); in __libc_android_log_event() 571 realtime_ts.tv_sec = ts.tv_sec; in __libc_android_log_event() 572 realtime_ts.tv_nsec = ts.tv_nsec; in __libc_android_log_event()
|
D | ndk_cruft.cpp | 104 extern "C" char* strtotimeval(const char* str, struct timeval* ts) { in strtotimeval() argument 106 ts->tv_sec = strtoumax(str, &s, 10); in strtotimeval() 126 ts->tv_usec = fractional_seconds; in strtotimeval()
|
D | pthread_rwlock.cpp | 307 timespec ts; in __pthread_rwlock_timedrdlock() local 311 rel_timeout = &ts; in __pthread_rwlock_timedrdlock() 385 timespec ts; in __pthread_rwlock_timedwrlock() local 389 rel_timeout = &ts; in __pthread_rwlock_timedwrlock()
|
D | pthread_mutex.cpp | 320 timespec ts; in __pthread_normal_mutex_lock() local 323 rel_timeout = &ts; in __pthread_normal_mutex_lock() 488 timespec ts; in __pthread_mutex_lock_with_timeout() local 491 rel_timeout = &ts; in __pthread_mutex_lock_with_timeout()
|
/bionic/libc/private/ |
D | bionic_time_conversions.h | 37 __LIBC_HIDDEN__ bool timespec_from_timeval(timespec& ts, const timeval& tv); 38 __LIBC_HIDDEN__ void timespec_from_ms(timespec& ts, const int ms); 40 __LIBC_HIDDEN__ void timeval_from_timespec(timeval& tv, const timespec& ts); 42 __LIBC_HIDDEN__ bool timespec_from_absolute_timespec(timespec& ts, const timespec& abs_ts, clockid_…
|
/bionic/tests/ |
D | semaphore_test.cpp | 94 static inline void timespec_add_ms(timespec& ts, size_t ms) { in timespec_add_ms() argument 95 ts.tv_sec += ms / 1000; in timespec_add_ms() 96 ts.tv_nsec += (ms % 1000) * 1000000; in timespec_add_ms() 97 if (ts.tv_nsec >= NS_PER_S) { in timespec_add_ms() 98 ts.tv_sec++; in timespec_add_ms() 99 ts.tv_nsec -= NS_PER_S; in timespec_add_ms() 107 timespec ts; in TEST() local 108 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST() 109 timespec_add_ms(ts, 100); in TEST() 112 ASSERT_EQ(-1, sem_timedwait(&s, &ts)); in TEST() [all …]
|
D | time_test.cpp | 164 itimerspec ts; in SetTime() local 165 ts.it_value.tv_sec = value_s; in SetTime() 166 ts.it_value.tv_nsec = value_ns; in SetTime() 167 ts.it_interval.tv_sec = interval_s; in SetTime() 168 ts.it_interval.tv_nsec = interval_ns; in SetTime() 169 ASSERT_EQ(0, timer_settime(t, 0, &ts, NULL)); in SetTime() 221 itimerspec ts; in TEST() local 222 ts.it_value.tv_sec = 0; in TEST() 223 ts.it_value.tv_nsec = 1; in TEST() 224 ts.it_interval.tv_sec = 0; in TEST() [all …]
|
D | sys_socket_test.cpp | 156 struct timespec ts; in TestRecvMMsg() local 157 memset(&ts, 0, sizeof(ts)); in TestRecvMMsg() 158 ts.tv_sec = 5; in TestRecvMMsg() 159 ts.tv_nsec = 0; in TestRecvMMsg() 161 static_cast<size_t>(recvmmsg(fd_acc, msgs, NUM_RECV_MSGS, 0, &ts))) in TestRecvMMsg()
|
D | pthread_test.cpp | 470 timespec ts; in TEST() local 471 ASSERT_EQ(0, clock_gettime(c, &ts)); in TEST() 1119 timespec ts; in TEST() local 1120 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST() 1121 ts.tv_nsec += 1; in TEST() 1122 ASSERT_EQ(ETIMEDOUT, pthread_mutex_timedlock(&m, &ts)); in TEST() 1127 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST() 1128 ts.tv_nsec += 1; in TEST() 1129 ASSERT_EQ(0, pthread_mutex_timedlock(&m, &ts)); in TEST()
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
D | res_random.c | 177 struct timespec ts; in res_initid() local 221 clock_gettime(CLOCK_MONOTONIC, &ts); in res_initid() 222 ru_reseed = ts.tv_sec + RU_OUT; in res_initid() 229 struct timespec ts; in res_randomid() local 233 clock_gettime(CLOCK_MONOTONIC, &ts); in res_randomid() 237 if (ru_counter >= RU_MAX || ts.tv_sec > ru_reseed) in res_randomid()
|
/bionic/libc/kernel/uapi/linux/ |
D | errqueue.h | 44 struct timespec ts[3]; member
|
D | ptp_clock.h | 65 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; member
|
D | omap3isp.h | 106 struct timeval ts; member
|
/bionic/libc/upstream-netbsd/lib/libc/isc/ |
D | ev_timers.c | 168 struct timespec ts; in evTimeSpec() local 170 ts.tv_sec = tv.tv_sec; in evTimeSpec() 171 ts.tv_nsec = tv.tv_usec * 1000; in evTimeSpec() 172 return (ts); in evTimeSpec() 176 evTimeVal(struct timespec ts) { in evTimeVal() argument 179 tv.tv_sec = ts.tv_sec; in evTimeVal() 180 tv.tv_usec = (suseconds_t)(ts.tv_nsec / 1000); in evTimeVal()
|
/bionic/libc/tzcode/ |
D | localtime.c | 531 struct state *ts = &lsp->u.st; in tzload() local 535 result = tzparse(&up->buf[1], ts, FALSE); in tzload() 536 if (result == 0 && ts->typecnt == 2 && in tzload() 537 sp->charcnt + ts->charcnt <= TZ_MAX_CHARS) { in tzload() 539 ts->ttis[i].tt_abbrind += in tzload() 541 for (i = 0; i < ts->charcnt; ++i) in tzload() 543 ts->chars[i]; in tzload() 545 while (i < ts->timecnt && in tzload() 546 ts->ats[i] <= in tzload() 549 while (i < ts->timecnt && in tzload() [all …]
|
/bionic/libc/dns/resolv/ |
D | res_cache.c | 1301 struct timespec ts = {0,0}; in _cache_check_pending_request_locked() local 1303 ts.tv_sec = _time_now() + PENDING_REQUEST_TIMEOUT; in _cache_check_pending_request_locked() 1304 pthread_cond_timedwait(&ri->cond, &_res_cache_list_lock, &ts); in _cache_check_pending_request_locked()
|