| /freebsd/crypto/openssl/test/ |
| H A D | time_test.c | 16 struct timeval tv; in test_time_to_timeval() local 20 tv = ossl_time_to_timeval(a); in test_time_to_timeval() 21 if (!TEST_long_eq(tv.tv_sec, 0) || !TEST_long_eq(tv.tv_usec, 0)) in test_time_to_timeval() 25 if (!TEST_true(ossl_time_is_zero(ossl_time_from_timeval(tv)))) in test_time_to_timeval() 30 tv = ossl_time_to_timeval(a); in test_time_to_timeval() 31 if (!TEST_long_eq(tv.tv_sec, 0) || !TEST_long_eq(tv.tv_usec, 1)) in test_time_to_timeval() 34 tv = ossl_time_to_timeval(a); in test_time_to_timeval() 35 if (!TEST_long_eq(tv.tv_sec, 0) || !TEST_long_eq(tv.tv_usec, 1)) in test_time_to_timeval() 38 tv = ossl_time_to_timeval(a); in test_time_to_timeval() 39 if (!TEST_long_eq(tv.tv_sec, 0) || !TEST_long_eq(tv.tv_usec, 1)) in test_time_to_timeval() [all …]
|
| /freebsd/tests/sys/kern/acct/ |
| H A D | acct_test.c | 79 struct timeval tv; in ATF_TC_BODY() local 81 tv.tv_sec = 0; in ATF_TC_BODY() 82 tv.tv_usec = 0; in ATF_TC_BODY() 83 v.c = encode_timeval(tv); in ATF_TC_BODY() 110 struct timeval tv; in ATF_TC_BODY() local 112 tv.tv_sec = 1; in ATF_TC_BODY() 113 tv.tv_usec = 0; in ATF_TC_BODY() 114 v.c = encode_timeval(tv); in ATF_TC_BODY() 116 (float)tv.tv_sec * AHZ + tv.tv_usec, v); in ATF_TC_BODY() 127 struct timeval tv; in ATF_TC_BODY() local [all …]
|
| /freebsd/contrib/ntp/libntp/lib/isc/unix/ |
| H A D | stdtime.c | 41 fix_tv_usec(struct timeval *tv) { in fix_tv_usec() argument 44 if (tv->tv_usec < 0) { in fix_tv_usec() 47 tv->tv_sec -= 1; in fix_tv_usec() 48 tv->tv_usec += US_PER_S; in fix_tv_usec() 49 } while (tv->tv_usec < 0); in fix_tv_usec() 50 } else if (tv->tv_usec >= US_PER_S) { in fix_tv_usec() 53 tv->tv_sec += 1; in fix_tv_usec() 54 tv->tv_usec -= US_PER_S; in fix_tv_usec() 55 } while (tv->tv_usec >=US_PER_S); in fix_tv_usec() 67 struct timeval tv; in isc_stdtime_get() local [all …]
|
| H A D | time.c | 62 fix_tv_usec(struct timeval *tv) { in fix_tv_usec() argument 65 if (tv->tv_usec < 0) { in fix_tv_usec() 68 tv->tv_sec -= 1; in fix_tv_usec() 69 tv->tv_usec += US_PER_S; in fix_tv_usec() 70 } while (tv->tv_usec < 0); in fix_tv_usec() 71 } else if (tv->tv_usec >= US_PER_S) { in fix_tv_usec() 74 tv->tv_sec += 1; in fix_tv_usec() 75 tv->tv_usec -= US_PER_S; in fix_tv_usec() 76 } while (tv->tv_usec >=US_PER_S); in fix_tv_usec() 147 struct timeval tv; in isc_time_now() local [all …]
|
| /freebsd/usr.sbin/ypserv/common/ |
| H A D | yplib_host.c | 70 struct timeval tv; in yp_bind_host() local 94 tv.tv_sec = 10; in yp_bind_host() 95 tv.tv_usec = 0; in yp_bind_host() 101 client = clntudp_create(&rsrv_sin, program, version, tv, in yp_bind_host() 117 struct timeval tv; in yp_bind_local() local 126 tv.tv_sec = 10; in yp_bind_local() 127 tv.tv_usec = 0; in yp_bind_local() 129 client = clntudp_create(&rsrv_sin, program, version, tv, &rsrv_sock); in yp_bind_local() 143 struct timeval tv; in yp_match_host() local 149 tv.tv_sec = _yplib_host_timeout; in yp_match_host() [all …]
|
| /freebsd/tools/regression/poll/ |
| H A D | pipeselect.c | 19 #define SETUP(fd, rfds, tv) do { \ argument 22 (tv).tv_sec = 0; \ 23 (tv).tv_usec = 0; \ 62 struct timeval tv; in child() local 75 SETUP(fd, rfds, tv); in child() 76 if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0) in child() 106 SETUP(fd, rfds, tv); in child() 107 if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0) in child() 115 SETUP(fd, rfds, tv); in child() 116 if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0) in child() [all …]
|
| /freebsd/tools/regression/priv/ |
| H A D | priv_vfs_utimes.c | 90 struct timeval tv[2]; in priv_vfs_utimes_froot() local 93 tv[0].tv_sec = 0; in priv_vfs_utimes_froot() 94 tv[0].tv_usec = 0; in priv_vfs_utimes_froot() 95 tv[1].tv_sec = 0; in priv_vfs_utimes_froot() 96 tv[1].tv_usec = 0; in priv_vfs_utimes_froot() 97 error = utimes(fpath, tv); in priv_vfs_utimes_froot() 133 struct timeval tv[2]; in priv_vfs_utimes_fowner() local 136 tv[0].tv_sec = 0; in priv_vfs_utimes_fowner() 137 tv[0].tv_usec = 0; in priv_vfs_utimes_fowner() 138 tv[1].tv_sec = 0; in priv_vfs_utimes_fowner() [all …]
|
| /freebsd/sys/contrib/openzfs/tests/zfs-tests/tests/functional/hkdf/ |
| H A D | hkdf_test.c | 183 run_test(int i, const hkdf_tv_t *tv) in run_test() argument 190 ret = hkdf_sha512((uint8_t *)tv->ikm, tv->ikm_len, (uint8_t *)tv->salt, in run_test() 191 tv->salt_len, (uint8_t *)tv->info, tv->info_len, good, tv->okm_len); in run_test() 197 if (memcmp(good, tv->okm, tv->okm_len) != 0) { in run_test() 199 hexdump("Expected:", (uint8_t *)tv->okm, tv->okm_len); in run_test() 200 hexdump("Actual: ", good, tv->okm_len); in run_test()
|
| /freebsd/tools/build/ |
| H A D | futimens.c | 42 struct timeval now, tv[2], *tvp; in futimens() local 65 tv[0].tv_sec = times[0].tv_sec; in futimens() 66 tv[0].tv_usec = times[0].tv_nsec / 1000; in futimens() 67 tv[1].tv_sec = times[1].tv_sec; in futimens() 68 tv[1].tv_usec = times[1].tv_nsec / 1000; in futimens() 69 tvp = tv; in futimens() 75 tv[0].tv_sec = sb.st_atim.tv_sec; in futimens() 76 tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; in futimens() 79 tv[1].tv_sec = sb.st_mtim.tv_sec; in futimens() 80 tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; in futimens() [all …]
|
| H A D | utimensat.c | 42 struct timeval now, tv[2], *tvp; in utimensat() local 69 tv[0].tv_sec = times[0].tv_sec; in utimensat() 70 tv[0].tv_usec = times[0].tv_nsec / 1000; in utimensat() 71 tv[1].tv_sec = times[1].tv_sec; in utimensat() 72 tv[1].tv_usec = times[1].tv_nsec / 1000; in utimensat() 73 tvp = tv; in utimensat() 79 tv[0].tv_sec = sb.st_atim.tv_sec; in utimensat() 80 tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; in utimensat() 83 tv[1].tv_sec = sb.st_mtim.tv_sec; in utimensat() 84 tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; in utimensat() [all …]
|
| /freebsd/sys/contrib/openzfs/lib/libspl/include/sys/ |
| H A D | time.h | 86 struct timeval tv; in gethrestime() local 87 (void) gettimeofday(&tv, NULL); in gethrestime() 88 ts->tv_sec = tv.tv_sec; in gethrestime() 89 ts->tv_nsec = tv.tv_usec * NSEC_PER_USEC; in gethrestime() 95 struct timeval tv; in gethrestime_sec() local 96 (void) gettimeofday(&tv, NULL); in gethrestime_sec() 97 return (tv.tv_sec); in gethrestime_sec() 103 struct timeval tv; in getlrtime() local 104 (void) gettimeofday(&tv, NULL); in getlrtime() 105 return ((((uint64_t)tv.tv_sec) * NANOSEC) + in getlrtime() [all …]
|
| /freebsd/contrib/ntp/sntp/libevent/ |
| H A D | evutil_time.c | 72 evutil_gettimeofday(struct timeval *tv, struct timezone *tz) in evutil_gettimeofday() argument 93 if (tv == NULL) in evutil_gettimeofday() 118 tv->tv_sec = (long) (ft.ft_64 / UNITS_PER_SEC); in evutil_gettimeofday() 119 tv->tv_usec = (long) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC); in evutil_gettimeofday() 128 evutil_tv_to_msec_(const struct timeval *tv) in evutil_tv_to_msec_() argument 130 if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG) in evutil_tv_to_msec_() 133 return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000); in evutil_tv_to_msec_() 141 evutil_usleep_(const struct timeval *tv) in evutil_usleep_() argument 143 if (!tv) in evutil_usleep_() 151 usec = tv->tv_sec * 1000000LL + tv->tv_usec; in evutil_usleep_() [all …]
|
| /freebsd/contrib/libevent/ |
| H A D | evutil_time.c | 72 evutil_gettimeofday(struct timeval *tv, struct timezone *tz) in evutil_gettimeofday() argument 93 if (tv == NULL) in evutil_gettimeofday() 118 tv->tv_sec = (long) (ft.ft_64 / UNITS_PER_SEC); in evutil_gettimeofday() 119 tv->tv_usec = (long) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC); in evutil_gettimeofday() 128 evutil_tv_to_msec_(const struct timeval *tv) in evutil_tv_to_msec_() argument 130 if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG) in evutil_tv_to_msec_() 133 return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000); in evutil_tv_to_msec_() 141 evutil_usleep_(const struct timeval *tv) in evutil_usleep_() argument 143 if (!tv) in evutil_usleep_() 151 usec = tv->tv_sec * 1000000LL + tv->tv_usec; in evutil_usleep_() [all …]
|
| /freebsd/sys/compat/linuxkpi/common/include/linux/ |
| H A D | time.h | 50 struct timeval tv; in ns_to_timeval() 54 tv.tv_sec = 0; in ns_to_timeval() 55 tv.tv_usec = 0; in ns_to_timeval() 56 return (tv); in ns_to_timeval() 59 tv.tv_sec = nsec / NSEC_PER_SEC; in ns_to_timeval() 62 tv.tv_sec--; in ns_to_timeval() 65 tv.tv_usec = rem / 1000; in ns_to_timeval() 66 return (tv); 70 timeval_to_ns(const struct timeval *tv) in timeval_to_ns() 72 return ((int64_t)tv in timeval_to_ns() 48 struct timeval tv; ns_to_timeval() local 68 timeval_to_ns(const struct timeval * tv) timeval_to_ns() argument [all...] |
| /freebsd/contrib/ntp/sntp/libevent/test/ |
| H A D | test-time.c | 63 struct timeval tv; in time_cb() local 71 tv.tv_sec = 0; in time_cb() 72 tv.tv_usec = rand_int(50000); in time_cb() 73 if (tv.tv_usec % 2 || called < NEVENT) in time_cb() 74 evtimer_add(ev[j], &tv); in time_cb() 85 struct timeval tv; in main() local 107 tv.tv_sec = 0; in main() 108 tv.tv_usec = rand_int(50000); in main() 109 evtimer_add(ev[i], &tv); in main()
|
| /freebsd/contrib/libevent/test/ |
| H A D | test-time.c | 63 struct timeval tv; in time_cb() local 71 tv.tv_sec = 0; in time_cb() 72 tv.tv_usec = rand_int(50000); in time_cb() 73 if (tv.tv_usec % 2 || called < NEVENT) in time_cb() 74 evtimer_add(ev[j], &tv); in time_cb() 85 struct timeval tv; in main() local 107 tv.tv_sec = 0; in main() 108 tv.tv_usec = rand_int(50000); in main() 109 evtimer_add(ev[i], &tv); in main()
|
| /freebsd/sys/contrib/libsodium/test/default/ |
| H A D | xchacha20.c | 32 const HChaCha20TV *tv; in tv_hchacha20() local 46 tv = &tvs[i]; in tv_hchacha20() 48 tv->key, strlen(tv->key), NULL, NULL, NULL); in tv_hchacha20() 50 tv->in, strlen(tv->in), NULL, NULL, NULL); in tv_hchacha20() 52 tv->out, strlen(tv->out), NULL, NULL, NULL); in tv_hchacha20() 104 const XChaCha20TV *tv; in tv_stream_xchacha20() local 117 tv = &tvs[i]; in tv_stream_xchacha20() 120 tv->key, strlen(tv->key), NULL, NULL, NULL); in tv_stream_xchacha20() 122 tv->nonce, strlen(tv->nonce), NULL, NULL, NULL); in tv_stream_xchacha20() 124 tv->out, strlen(tv->out), NULL, &out_len, NULL); in tv_stream_xchacha20() [all …]
|
| /freebsd/contrib/pf/libevent/ |
| H A D | event.c | 348 event_loopexit(struct timeval *tv) in event_loopexit() argument 351 current_base, tv)); in event_loopexit() 355 event_base_loopexit(struct event_base *event_base, struct timeval *tv) in event_base_loopexit() argument 358 event_base, tv)); in event_base_loopexit() 374 struct timeval tv; in event_base_loop() local 402 gettime(&tv); in event_base_loop() 403 if (timercmp(&tv, &base->event_tv, <)) { in event_base_loop() 407 timersub(&base->event_tv, &tv, &off); in event_base_loop() 410 base->event_tv = tv; in event_base_loop() 413 timeout_next(base, &tv); in event_base_loop() [all …]
|
| /freebsd/crypto/heimdal/lib/krb5/ |
| H A D | time.c | 55 struct timeval tv; in krb5_set_real_time() local 57 gettimeofday(&tv, NULL); in krb5_set_real_time() 59 context->kdc_sec_offset = sec - tv.tv_sec; in krb5_set_real_time() 66 context->kdc_usec_offset = usec - tv.tv_usec; in krb5_set_real_time() 73 context->kdc_usec_offset = tv.tv_usec; in krb5_set_real_time() 99 struct timeval tv; in krb5_us_timeofday() local 101 gettimeofday (&tv, NULL); in krb5_us_timeofday() 103 *sec = tv.tv_sec + context->kdc_sec_offset; in krb5_us_timeofday() 104 *usec = tv.tv_usec; /* XXX */ in krb5_us_timeofday()
|
| /freebsd/sys/netinet/ |
| H A D | tcp_hpts.h | 161 tcp_get_u64_usecs(struct timeval *tv) in tcp_get_u64_usecs() argument 165 if (tv == NULL) in tcp_get_u64_usecs() 166 tv = &tvd; in tcp_get_u64_usecs() 167 microuptime(tv); in tcp_get_u64_usecs() 168 return (tcp_tv_to_lusec(tv)); in tcp_get_u64_usecs() 172 tcp_get_usecs(struct timeval *tv) in tcp_get_usecs() argument 176 if (tv == NULL) in tcp_get_usecs() 177 tv = &tvd; in tcp_get_usecs() 178 microuptime(tv); in tcp_get_usecs() 179 return (tcp_tv_to_usec(tv)); in tcp_get_usecs()
|
| /freebsd/contrib/ntp/sntp/libevent/sample/ |
| H A D | time-test.c | 59 struct timeval tv; in timeout_cb() local 60 evutil_timerclear(&tv); in timeout_cb() 61 tv.tv_sec = 2; in timeout_cb() 62 event_add(timeout, &tv); in timeout_cb() 70 struct timeval tv; in main() local 97 evutil_timerclear(&tv); in main() 98 tv.tv_sec = 2; in main() 99 event_add(&timeout, &tv); in main()
|
| /freebsd/contrib/libevent/sample/ |
| H A D | time-test.c | 59 struct timeval tv; in timeout_cb() local 60 evutil_timerclear(&tv); in timeout_cb() 61 tv.tv_sec = 2; in timeout_cb() 62 event_add(timeout, &tv); in timeout_cb() 70 struct timeval tv; in main() local 97 evutil_timerclear(&tv); in main() 98 tv.tv_sec = 2; in main() 99 event_add(&timeout, &tv); in main()
|
| /freebsd/sys/contrib/openzfs/module/zfs/ |
| H A D | zfs_crrd.c | 178 rrd_query(rrd_t *rrd, hrtime_t tv, dbrrd_rounding_t rounding) in rrd_query() argument 186 if (tv < cur->rrdd_time) { in rrd_query() 192 if (tv <= cur->rrdd_time) { in rrd_query() 203 dbrrd_closest(hrtime_t tv, const rrd_data_t *r1, const rrd_data_t *r2) in dbrrd_closest() argument 211 return (ABS(tv - (hrtime_t)r1->rrdd_time) < in dbrrd_closest() 212 ABS(tv - (hrtime_t)r2->rrdd_time) ? r1 : r2); in dbrrd_closest() 216 dbrrd_query(dbrrd_t *r, hrtime_t tv, dbrrd_rounding_t rounding) in dbrrd_query() argument 221 dm = rrd_query(&r->dbr_minutes, tv, rounding); in dbrrd_query() 222 dd = rrd_query(&r->dbr_days, tv, rounding); in dbrrd_query() 223 dy = rrd_query(&r->dbr_months, tv, rounding); in dbrrd_query() [all …]
|
| /freebsd/contrib/netbsd-tests/lib/librumphijack/ |
| H A D | h_client.c | 52 struct timeval tv; in main() local 56 tv.tv_sec = 0; in main() 57 tv.tv_usec = 1; in main() 64 rv = select(pipefd[0]+1, &rfds, NULL, NULL, &tv); in main() 75 struct timeval tv; in main() local 78 tv.tv_sec = 0; in main() 79 tv.tv_usec = 1; in main() 83 rv = select(100, &fds, &fds, &fds, &tv); in main() 89 rv = select(0, NULL, NULL, NULL, &tv); in main()
|
| /freebsd/contrib/ntp/sntp/libevent/include/event2/ |
| H A D | event_compat.h | 198 #define timeout_add(ev, tv) event_add((ev), (tv)) argument 201 #define timeout_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv)) argument 212 #define signal_add(ev, tv) event_add((ev), (tv)) argument 216 #define signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv)) argument
|