Home
last modified time | relevance | path

Searched refs:ts (Results 1 – 24 of 24) sorted by relevance

/bionic/libc/bionic/
Dbionic_time_conversions.cpp33 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()
55 void absolute_timespec_from_timespec(timespec& abs_ts, const timespec& ts, clockid_t clock) { in absolute_timespec_from_timespec() argument
[all …]
Dpoll.cpp41 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 …]
Dclock.cpp37 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()
Dutimes.cpp37 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()
Dclock_getcpuclockid.cpp43 timespec ts; in clock_getcpuclockid() local
44 if (clock_getres(result, &ts) == -1) { in clock_getcpuclockid()
Dpthread_cond.cpp232 timespec ts; in pthread_cond_timedwait_relative_np() local
235 absolute_timespec_from_timespec(ts, *rel_timeout, CLOCK_MONOTONIC); in pthread_cond_timedwait_relative_np()
236 abs_timeout = &ts; in pthread_cond_timedwait_relative_np()
243 timespec ts; in pthread_cond_timeout_np() local
244 timespec_from_ms(ts, ms); in pthread_cond_timeout_np()
245 return pthread_cond_timedwait_relative_np(cond_interface, mutex, &ts); in pthread_cond_timeout_np()
Dposix_timers.cpp207 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()
Dgetentropy_linux.c359 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()
Dlibc_logging.cpp565 timespec ts; in __libc_write_log() local
566 clock_gettime(__android_log_clockid(), &ts); in __libc_write_log()
568 realtime_ts.tv_sec = ts.tv_sec; in __libc_write_log()
569 realtime_ts.tv_nsec = ts.tv_nsec; in __libc_write_log()
608 timespec ts; in __libc_android_log_event() local
609 clock_gettime(__android_log_clockid(), &ts); in __libc_android_log_event()
611 realtime_ts.tv_sec = ts.tv_sec; in __libc_android_log_event()
612 realtime_ts.tv_nsec = ts.tv_nsec; in __libc_android_log_event()
Dndk_cruft.cpp104 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()
Dpthread_mutex.cpp616 timespec ts; in pthread_mutex_lock_timeout_np() local
617 timespec_from_ms(ts, ms); in pthread_mutex_lock_timeout_np()
619 absolute_timespec_from_timespec(abs_timeout, ts, CLOCK_MONOTONIC); in pthread_mutex_lock_timeout_np()
/bionic/libc/private/
Dbionic_time_conversions.h40 __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) { in check_timespec() argument
51 if (null_allowed && ts == nullptr) { in check_timespec()
56 if (ts->tv_nsec < 0 || ts->tv_nsec >= NS_PER_S) { in check_timespec()
59 if (ts->tv_sec < 0) { in check_timespec()
/bionic/tests/
Dsemaphore_test.cpp95 static inline void timespec_add_ms(timespec& ts, size_t ms) { in timespec_add_ms() argument
96 ts.tv_sec += ms / 1000; in timespec_add_ms()
97 ts.tv_nsec += (ms % 1000) * 1000000; in timespec_add_ms()
98 if (ts.tv_nsec >= NS_PER_S) { in timespec_add_ms()
99 ts.tv_sec++; in timespec_add_ms()
100 ts.tv_nsec -= NS_PER_S; in timespec_add_ms()
108 timespec ts; in TEST() local
109 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST()
110 timespec_add_ms(ts, 100); in TEST()
113 ASSERT_EQ(-1, sem_timedwait(&s, &ts)); in TEST()
[all …]
Dtime_test.cpp197 itimerspec ts; in SetTime() local
198 ts.it_value.tv_sec = value_s; in SetTime()
199 ts.it_value.tv_nsec = value_ns; in SetTime()
200 ts.it_interval.tv_sec = interval_s; in SetTime()
201 ts.it_interval.tv_nsec = interval_ns; in SetTime()
202 ASSERT_EQ(0, timer_settime(t, 0, &ts, NULL)); in SetTime()
251 itimerspec ts; in TEST() local
252 ts.it_value.tv_sec = 0; in TEST()
253 ts.it_value.tv_nsec = 1; in TEST()
254 ts.it_interval.tv_sec = 0; in TEST()
[all …]
Dpthread_test.cpp465 timespec ts; in TEST() local
466 ASSERT_EQ(0, clock_gettime(c, &ts)); in TEST()
776 timespec ts; in TEST() local
777 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST()
778 ts.tv_sec += 1; in TEST()
780 return pthread_rwlock_timedwrlock(lock, &ts); in TEST()
812 timespec ts; in TEST() local
813 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &ts)); in TEST()
814 ts.tv_sec += 1; in TEST()
816 return pthread_rwlock_timedrdlock(lock, &ts); in TEST()
[all …]
Dsys_socket_test.cpp156 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()
/bionic/libc/include/sys/
Dtime.h80 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ argument
81 (ts)->tv_sec = (tv)->tv_sec; \
82 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
84 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ argument
85 (tv)->tv_sec = (ts)->tv_sec; \
86 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
/bionic/libc/upstream-openbsd/lib/libc/net/
Dres_random.c178 struct timespec ts; in res_initid() local
222 clock_gettime(CLOCK_MONOTONIC, &ts); in res_initid()
223 ru_reseed = ts.tv_sec + RU_OUT; in res_initid()
230 struct timespec ts; in __res_randomid() local
235 clock_gettime(CLOCK_MONOTONIC, &ts); in __res_randomid()
240 if (ru_counter >= RU_MAX || ts.tv_sec > ru_reseed || pid != ru_pid) { in __res_randomid()
/bionic/libc/kernel/uapi/linux/
Derrqueue.h44 struct timespec ts[3]; member
Dptp_clock.h65 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; member
Domap3isp.h106 struct timeval ts; member
/bionic/libc/upstream-netbsd/lib/libc/isc/
Dev_timers.c168 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/
Dlocaltime.c578 struct state *ts = &lsp->u.st; in tzloadbody() local
581 if (tzparse(&up->buf[1], ts, false) in tzloadbody()
582 && ts->typecnt == 2) { in tzloadbody()
594 char *tsabbr = ts->chars + ts->ttis[i].tt_abbrind; in tzloadbody()
598 ts->ttis[i].tt_abbrind = j; in tzloadbody()
607 ts->ttis[i].tt_abbrind = j; in tzloadbody()
614 for (i = 0; i < ts->timecnt; i++) in tzloadbody()
615 if (sp->ats[sp->timecnt - 1] < ts->ats[i]) in tzloadbody()
617 while (i < ts->timecnt in tzloadbody()
619 sp->ats[sp->timecnt] = ts->ats[i]; in tzloadbody()
[all …]
/bionic/libc/dns/resolv/
Dres_cache.c1306 struct timespec ts = {0,0}; in _cache_check_pending_request_locked() local
1308 ts.tv_sec = _time_now() + PENDING_REQUEST_TIMEOUT; in _cache_check_pending_request_locked()
1309 pthread_cond_timedwait(&ri->cond, &_res_cache_list_lock, &ts); in _cache_check_pending_request_locked()