/bionic/libc/bionic/ |
D | sys_time.cpp | 37 static int futimesat(int fd, const char* path, const timeval tv[2], int flags) { in futimesat() 39 if (tv && (!timespec_from_timeval(ts[0], tv[0]) || !timespec_from_timeval(ts[1], tv[1]))) { in futimesat() 43 return utimensat(fd, path, tv ? ts : nullptr, flags); in futimesat() 46 int utimes(const char* path, const timeval tv[2]) { in utimes() 47 return futimesat(AT_FDCWD, path, tv, 0); in utimes() 50 int lutimes(const char* path, const timeval tv[2]) { in lutimes() 51 return futimesat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW); in lutimes() 54 int futimesat(int fd, const char* path, const timeval tv[2]) { in futimesat() 55 return futimesat(fd, path, tv, 0); in futimesat() 58 int futimes(int fd, const timeval tv[2]) { in futimes() [all …]
|
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() 38 if (tv.tv_usec >= 1000000 || tv.tv_usec < 0) { in timespec_from_timeval() 41 ts.tv_nsec = tv.tv_usec * 1000; in timespec_from_timeval() 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()
|
D | vdso.cpp | 54 int gettimeofday(timeval* tv, struct timezone* tz) { in gettimeofday() argument 58 return vdso_return(vdso_gettimeofday(tv, tz)); in gettimeofday() 60 return __gettimeofday(tv, tz); in gettimeofday() 70 timeval tv; in time() local 71 if (gettimeofday(&tv, nullptr) == -1) return -1; in time() 72 if (t) *t = tv.tv_sec; in time() 73 return tv.tv_sec; in time()
|
D | poll.cpp | 81 int select(int fd_count, fd_set* read_fds, fd_set* write_fds, fd_set* error_fds, timeval* tv) { in select() argument 84 if (tv != nullptr) { in select() 85 if (!timespec_from_timeval(ts, *tv)) { in select() 92 if (tv != nullptr) { in select() 93 timeval_from_timespec(*tv, ts); in select()
|
D | ndk_cruft.cpp | 305 struct timeval tv; in ftime() local 308 if (gettimeofday(&tv, &tz) < 0) in ftime() 311 tb->time = tv.tv_sec; in ftime() 312 tb->millitm = (tv.tv_usec + 500) / 1000; in ftime()
|
/bionic/tests/ |
D | sys_time_test.cpp | 35 timeval tv[2] = {}; in TEST() local 37 tv[0].tv_usec = -123; in TEST() 38 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 40 tv[0].tv_usec = 1234567; in TEST() 41 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 44 tv[0].tv_usec = 0; in TEST() 46 tv[1].tv_usec = -123; in TEST() 47 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 49 tv[1].tv_usec = 1234567; in TEST() 50 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() [all …]
|
D | sys_select_test.cpp | 107 timeval tv; in TEST() local 108 tv.tv_sec = -1; in TEST() 109 tv.tv_usec = 0; in TEST() 110 ASSERT_EQ(-1, select(max, &r, &w, &e, &tv)); in TEST() 114 tv.tv_sec = 1; in TEST() 120 ASSERT_EQ(1, select(fd+1, &r, nullptr, nullptr, &tv)); in TEST() 122 ASSERT_EQ(0, tv.tv_sec); in TEST() 123 ASSERT_NE(0, tv.tv_usec); in TEST() 162 timespec tv; in TEST() local 163 tv.tv_sec = -1; in TEST() [all …]
|
D | sys_socket_test.cpp | 87 timeval tv; in RunTest() local 88 tv.tv_sec = 5; in RunTest() 89 tv.tv_usec = 0; in RunTest() 90 ASSERT_LT(0, select(fd+1, &read_set, nullptr, nullptr, &tv)); in RunTest() 217 timeval tv; in TestSendMMsg() local 218 tv.tv_sec = 5; in TestSendMMsg() 219 tv.tv_usec = 0; in TestSendMMsg() 220 ASSERT_LT(0, select(fd_acc+1, &read_set, nullptr, nullptr, &tv)); in TestSendMMsg()
|
/bionic/libc/upstream-netbsd/lib/libc/gen/ |
D | utime.c | 52 struct timeval tv[2], *tvp; in utime() local 59 tv[0].tv_sec = times->actime; in utime() 60 tv[1].tv_sec = times->modtime; in utime() 61 tv[0].tv_usec = tv[1].tv_usec = 0; in utime() 62 tvp = tv; in utime()
|
/bionic/libm/upstream-freebsd/lib/msun/src/ |
D | s_exp2f.c | 99 double tv, twopk, u, z; in exp2f() local 133 tv = exp2ft[i0]; in exp2f() 134 u = tv * z; in exp2f() 135 tv = tv + u * (P1 + z * P2) + u * (z * z) * (P3 + z * P4); in exp2f() 138 return (tv * twopk); in exp2f()
|
/bionic/libc/include/sys/ |
D | time.h | 89 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ argument 90 (ts)->tv_sec = (tv)->tv_sec; \ 91 (ts)->tv_nsec = (tv)->tv_usec * 1000; \ 93 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ argument 94 (tv)->tv_sec = (ts)->tv_sec; \ 95 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
|
/bionic/libc/private/ |
D | bionic_time_conversions.h | 40 __LIBC_HIDDEN__ bool timespec_from_timeval(timespec& ts, const timeval& tv); 43 __LIBC_HIDDEN__ void timeval_from_timespec(timeval& tv, const timespec& ts);
|
/bionic/benchmarks/ |
D | time_benchmark.cpp | 152 timeval tv; in BM_time_gettimeofday() local 154 gettimeofday(&tv, nullptr); in BM_time_gettimeofday() 160 timeval tv; in BM_time_gettimeofday_syscall() local 162 syscall(__NR_gettimeofday, &tv, nullptr); in BM_time_gettimeofday_syscall()
|
/bionic/libc/upstream-netbsd/lib/libc/isc/ |
D | ev_timers.c | 167 evTimeSpec(struct timeval tv) { in evTimeSpec() argument 170 ts.tv_sec = tv.tv_sec; in evTimeSpec() 171 ts.tv_nsec = tv.tv_usec * 1000; in evTimeSpec() 177 struct timeval tv; in evTimeVal() local 179 tv.tv_sec = ts.tv_sec; in evTimeVal() 180 tv.tv_usec = (suseconds_t)(ts.tv_nsec / 1000); in evTimeVal() 181 return (tv); in evTimeVal()
|
/bionic/libc/dns/resolv/ |
D | res_cache.c | 349 struct timeval tv; in _time_now() local 351 gettimeofday( &tv, NULL ); in _time_now() 352 return tv.tv_sec; in _time_now()
|