/freebsd/tools/build/ |
H A D | futimens.c | 46 if (times == NULL || (times[0].tv_nsec == UTIME_NOW && in futimens() 47 times[1].tv_nsec == UTIME_NOW)) in futimens() 49 else if (times[0].tv_nsec == UTIME_OMIT && in futimens() 50 times[1].tv_nsec == UTIME_OMIT) in futimens() 53 if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && in futimens() 54 times[0].tv_nsec != UTIME_NOW && in futimens() 55 times[0].tv_nsec != UTIME_OMIT) { in futimens() 59 if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && in futimens() 60 times[1].tv_nsec != UTIME_NOW && in futimens() 61 times[1].tv_nsec != UTIME_OMIT) { in futimens() [all …]
|
H A D | utimensat.c | 50 if (times == NULL || (times[0].tv_nsec == UTIME_NOW && in utimensat() 51 times[1].tv_nsec == UTIME_NOW)) in utimensat() 53 else if (times[0].tv_nsec == UTIME_OMIT && in utimensat() 54 times[1].tv_nsec == UTIME_OMIT) in utimensat() 57 if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && in utimensat() 58 times[0].tv_nsec != UTIME_NOW && in utimensat() 59 times[0].tv_nsec != UTIME_OMIT) { in utimensat() 63 if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && in utimensat() 64 times[1].tv_nsec != UTIME_NOW && in utimensat() 65 times[1].tv_nsec != UTIME_OMIT) { in utimensat() [all …]
|
/freebsd/contrib/ntp/libntp/ |
H A D | timespecops.c | 61 if (x.tv_nsec < -3l * NANOSECONDS || in normalize_tspec() 62 x.tv_nsec > 3l * NANOSECONDS) { in normalize_tspec() 63 z = x.tv_nsec / NANOSECONDS; in normalize_tspec() 64 x.tv_nsec -= z * NANOSECONDS; in normalize_tspec() 72 if (x.tv_nsec < 0) in normalize_tspec() 74 x.tv_nsec += NANOSECONDS; in normalize_tspec() 76 } while (x.tv_nsec < 0); in normalize_tspec() 77 else if (x.tv_nsec >= NANOSECONDS) in normalize_tspec() 79 x.tv_nsec -= NANOSECONDS; in normalize_tspec() 81 } while (x.tv_nsec >= NANOSECONDS); in normalize_tspec() [all …]
|
/freebsd/usr.sbin/rtadvd/ |
H A D | timer_subr.h | 38 ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ 43 (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ 44 if ((vsp)->tv_nsec >= 1000000000L) { \ 46 (vsp)->tv_nsec -= 1000000000L; \ 52 (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ 53 if ((vsp)->tv_nsec < 0) { \ 55 (vsp)->tv_nsec += 1000000000L; \
|
/freebsd/contrib/libfido2/openbsd-compat/ |
H A D | time.h | 38 (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ 39 if ((vsp)->tv_nsec >= 1000000000L) { \ 41 (vsp)->tv_nsec -= 1000000000L; \ 48 (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ 49 if ((vsp)->tv_nsec < 0) { \ 51 (vsp)->tv_nsec += 1000000000L; \ 57 ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
|
/freebsd/sys/contrib/ck/src/ |
H A D | ck_ec_timeutil.h | 42 .tv_nsec = NSEC_MAX in timespec_add_ns() 53 ret.tv_nsec = ts.tv_nsec; in timespec_add_ns() 58 sum_ns = ns + ts.tv_nsec; in timespec_add_ns() 69 ret.tv_nsec = sum_ns; in timespec_add_ns() 84 .tv_nsec = NSEC_MAX in timespec_add() 90 if (inc.tv_sec < 0 || inc.tv_nsec < 0 || inc.tv_nsec > NSEC_MAX) { in timespec_add() 101 nsec = (unsigned long)ts.tv_nsec + inc.tv_nsec; in timespec_add() 113 ret.tv_nsec = nsec; in timespec_add() 125 if (x.tv_nsec != y.tv_nsec) { in timespec_cmp() 126 return (x.tv_nsec < y.tv_nsec) ? -1 : 1; in timespec_cmp()
|
/freebsd/lib/libc/isc/ |
H A D | ev_timers.c | 75 x.tv_nsec = nsec; in evConsTime() 84 x.tv_nsec = addend1.tv_nsec + addend2.tv_nsec; in evAddTime() 85 if (x.tv_nsec >= BILLION) { in evAddTime() 87 x.tv_nsec -= BILLION; in evAddTime() 97 if (minuend.tv_nsec >= subtrahend.tv_nsec) in evSubTime() 98 x.tv_nsec = minuend.tv_nsec - subtrahend.tv_nsec; in evSubTime() 100 x.tv_nsec = BILLION - subtrahend.tv_nsec + minuend.tv_nsec; in evSubTime() 111 x = a.tv_nsec - b.tv_nsec; in evCmpTime() 161 ts.tv_nsec = tv.tv_usec * 1000; in evTimeSpec() 171 tv.tv_usec = ts.tv_nsec / 1000; in evTimeVal() [all …]
|
/freebsd/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_nanosleep.c | 77 tsn.tv_nsec = i; in ATF_TC_BODY() 95 (unsigned long long)tsn.tv_sec, tsn.tv_nsec, in ATF_TC_BODY() 96 (unsigned long long)ts1.tv_sec, ts1.tv_nsec, in ATF_TC_BODY() 97 (unsigned long long)ts2.tv_sec, ts2.tv_nsec); in ATF_TC_BODY() 100 "(resolution = %lu nsec)", tsn.tv_nsec); in ATF_TC_BODY() 117 ts.tv_nsec = -1; in ATF_TC_BODY() 122 ts.tv_nsec = 1000000000; in ATF_TC_BODY() 127 ts.tv_nsec = 0; in ATF_TC_BODY() 161 tsn.tv_nsec = 0; in ATF_TC_BODY() 164 tsr.tv_nsec = 0; in ATF_TC_BODY() [all …]
|
H A D | t_clock_gettime.c | 111 + tsb.tv_nsec - tsa.tv_nsec; in check_timecounter() 120 (uintmax_t)tsa.tv_sec, (uintmax_t)tsa.tv_nsec, in check_timecounter() 121 (uintmax_t)tsb.tv_sec, (uintmax_t)tsb.tv_nsec, diff); in check_timecounter() 124 + tsb.tv_nsec - tsl.tv_nsec; in check_timecounter() 136 tsa.tv_nsec = tsb.tv_nsec; in check_timecounter() 140 long long r = res.tv_sec * 1000000000 + res.tv_nsec; in check_timecounter() 198 ts.tv_nsec = 100000000; in ATF_TC_BODY()
|
H A D | t_clock_nanosleep.c | 46 rqtp.tv_sec = 0; rqtp.tv_nsec = 0; in ATF_TC_BODY() 47 rmtp.tv_sec = -1; rmtp.tv_nsec = -1; in ATF_TC_BODY() 50 ATF_CHECK(rmtp.tv_sec == -1 && rmtp.tv_nsec == -1); in ATF_TC_BODY() 52 ATF_CHECK(rmtp.tv_sec == 0 && rmtp.tv_nsec == 0); in ATF_TC_BODY() 56 rmtp.tv_sec = -1; rmtp.tv_nsec = -1; in ATF_TC_BODY() 58 ATF_CHECK(rmtp.tv_sec == -1 && rmtp.tv_nsec == -1); in ATF_TC_BODY()
|
/freebsd/bin/ls/ |
H A D | cmp.c | 82 if (b->fts_statp->st_mtim.tv_nsec > in modcmp() 83 a->fts_statp->st_mtim.tv_nsec) in modcmp() 85 if (b->fts_statp->st_mtim.tv_nsec < in modcmp() 86 a->fts_statp->st_mtim.tv_nsec) in modcmp() 111 if (b->fts_statp->st_atim.tv_nsec > in acccmp() 112 a->fts_statp->st_atim.tv_nsec) in acccmp() 114 if (b->fts_statp->st_atim.tv_nsec < in acccmp() 115 a->fts_statp->st_atim.tv_nsec) in acccmp() 140 if (b->fts_statp->st_birthtim.tv_nsec > in birthcmp() 141 a->fts_statp->st_birthtim.tv_nsec) in birthcmp() [all …]
|
/freebsd/tools/tools/netmap/ |
H A D | ctrs.h | 50 if (a->tv_nsec >= b->tv_nsec) in timespec_ge() 60 .tv_nsec = a->tv_usec * 1000 in timeval2spec() 70 .tv_usec = a->tv_nsec / 1000 in timespec2val() 79 struct timespec ret = { a.tv_sec + b.tv_sec, a.tv_nsec + b.tv_nsec }; in timespec_add() 80 if (ret.tv_nsec >= 1000000000) { in timespec_add() 82 ret.tv_nsec -= 1000000000; in timespec_add() 90 struct timespec ret = { a.tv_sec - b.tv_sec, a.tv_nsec - b.tv_nsec }; in timespec_sub() 91 if (ret.tv_nsec < 0) { in timespec_sub() 93 ret.tv_nsec += 1000000000; in timespec_sub()
|
/freebsd/usr.sbin/rtsold/ |
H A D | rtsold.h | 132 ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ 137 (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ 138 if ((vsp)->tv_nsec >= 1000000000L) { \ 140 (vsp)->tv_nsec -= 1000000000L; \ 146 (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ 147 if ((vsp)->tv_nsec < 0) { \ 149 (vsp)->tv_nsec += 1000000000L; \
|
/freebsd/contrib/ntp/include/ |
H A D | timespecops.h | 54 ((x)->tv_nsec >= 0 && (x)->tv_nsec < NANOSECONDS) 76 x.tv_nsec += b.tv_nsec; in add_tspec() 91 x.tv_nsec += b; in add_tspec_ns() 107 x.tv_nsec -= b.tv_nsec; in sub_tspec() 122 x.tv_nsec -= b; in sub_tspec_ns() 136 x.tv_nsec = -a.tv_nsec; in neg_tspec() 187 return format_time_fraction(x.tv_sec, x.tv_nsec, 9); in tspectoa()
|
/freebsd/contrib/nvi/common/ |
H A D | util.h | 68 #define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) 69 #define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec) 72 ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ 77 (vvp)->tv_nsec += (uvp)->tv_nsec; \ 78 if ((vvp)->tv_nsec >= 1000000000) { \ 80 (vvp)->tv_nsec -= 1000000000; \ 86 (vvp)->tv_nsec -= (uvp)->tv_nsec; \ 87 if ((vvp)->tv_nsec < 0) { \ 89 (vvp)->tv_nsec += 1000000000; \
|
/freebsd/sys/kern/ |
H A D | kern_ntptime.c | 264 ntvp->time.tv_nsec = atv.tv_nsec; in ntp_gettime1() 765 u_nsec = tsp->tv_nsec; in hardpps() 770 v_nsec = u_nsec - pps_tf[0].tv_nsec; in hardpps() 776 pps_tf[0].tv_nsec = u_nsec; in hardpps() 793 if (pps_tf[0].tv_nsec > pps_tf[1].tv_nsec) { in hardpps() 794 if (pps_tf[1].tv_nsec > pps_tf[2].tv_nsec) { in hardpps() 795 v_nsec = pps_tf[1].tv_nsec; /* 0 1 2 */ in hardpps() 796 u_nsec = pps_tf[0].tv_nsec - pps_tf[2].tv_nsec; in hardpps() 797 } else if (pps_tf[2].tv_nsec > pps_tf[0].tv_nsec) { in hardpps() 798 v_nsec = pps_tf[0].tv_nsec; /* 2 0 1 */ in hardpps() [all …]
|
/freebsd/tools/tools/netrate/netsend/ |
H A D | netsend.c | 73 tsa->tv_nsec += tsb->tv_nsec; in timespec_add() 74 if (tsa->tv_nsec >= 1000000000) { in timespec_add() 76 tsa->tv_nsec -= 1000000000; in timespec_add() 88 if (a->tv_nsec >= b->tv_nsec) in timespec_ge() 105 curtime.tv_nsec = 0; in wait_time() 155 ns = a->interval.tv_nsec; in timing_loop() 159 (intmax_t)a->interval.tv_sec, a->interval.tv_nsec, in timing_loop() 160 (intmax_t)tmptime.tv_sec, tmptime.tv_nsec); in timing_loop() 177 tmptime.tv_nsec = 0; in timing_loop() 179 starttime.tv_nsec = 0; in timing_loop() [all …]
|
/freebsd/sys/contrib/zstd/programs/ |
H A D | timefn.c | 108 if (end.tv_nsec < begin.tv_nsec) { in UTIL_getSpanTime() 110 diff.tv_nsec = (end.tv_nsec + 1000000000ULL) - begin.tv_nsec; in UTIL_getSpanTime() 113 diff.tv_nsec = end.tv_nsec - begin.tv_nsec; in UTIL_getSpanTime() 123 micro += diff.tv_nsec / 1000ULL; in UTIL_getSpanTimeMicro() 132 nano += diff.tv_nsec; in UTIL_getSpanTimeNano()
|
/freebsd/sys/fs/nfs/ |
H A D | xdr_subs.h | 55 (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \ 57 (t)->tv_nsec = 0; \ 62 if ((f)->tv_nsec != -1) \ 63 ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \ 70 (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ 75 ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ 80 (t)->tv_nsec = (ntohl(((struct nfsv4_time *)(f))->nfsv4_nsec) % \ 87 ((struct nfsv4_time *)(t))->nfsv4_nsec = htonl((f)->tv_nsec); \
|
/freebsd/contrib/ntp/util/ |
H A D | pps-api.c | 22 (vvp)->tv_nsec -= (uvp)->tv_nsec; \ 23 if ((vvp)->tv_nsec < 0) { \ 25 (vvp)->tv_nsec += 1000000000; \ 36 printf("%d.%09d ", tsa->tv_sec, tsa->tv_nsec); in Chew() 37 printf("%d.%09d ", tsc->tv_sec, tsc->tv_nsec); in Chew() 42 printf("%.9f ", ts.tv_sec + ts.tv_nsec / 1e9); in Chew() 82 to.tv_nsec = 0; in main()
|
/freebsd/contrib/netbsd-tests/lib/libc/c063/ |
H A D | t_utimensat.c | 79 ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); in ATF_TC_BODY() 81 ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); in ATF_TC_BODY() 104 ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); in ATF_TC_BODY() 106 ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); in ATF_TC_BODY() 196 ATF_REQUIRE(st.st_atimespec.tv_nsec == tptr[0].tv_nsec); in ATF_TC_BODY() 198 ATF_REQUIRE(st.st_mtimespec.tv_nsec == tptr[1].tv_nsec); in ATF_TC_BODY()
|
/freebsd/tools/tools/netrate/netreceive/ |
H A D | netreceive.c | 79 tsa->tv_nsec += tsb->tv_nsec; in timespec_add() 80 if (tsa->tv_nsec >= 1000000000) { in timespec_add() 82 tsa->tv_nsec -= 1000000000; in timespec_add() 91 tsa->tv_nsec -= tsb->tv_nsec; in timespec_sub() 92 if (tsa->tv_nsec < 0) { in timespec_sub() 94 tsa->tv_nsec += 1000000000; in timespec_sub() 164 fprintf(stderr, "start at %ld.%09ld\n", then.tv_sec, then.tv_nsec); in main_thread() 183 pps = (pps * 1000000000) / (delta.tv_sec*1000000000 + delta.tv_nsec + 1); in main_thread() 184 bps = ((bc0 - bc1) * 8000000000) / (delta.tv_sec*1000000000 + delta.tv_nsec + 1); in main_thread() 187 (int)dn, delta.tv_sec, delta.tv_nsec); in main_thread()
|
/freebsd/tools/test/stress2/misc/ |
H A D | nanosleep.sh | 67 rqt.tv_nsec = N; 73 if (res.tv_nsec < N) 74 errx(1, "Short sleep: %ld", res.tv_nsec); 76 // (double)res.tv_nsec / 1e9); 77 if (m > res.tv_nsec) 78 m = res.tv_nsec;
|
/freebsd/contrib/libarchive/libarchive/ |
H A D | archive_entry_stat.c | 85 st->st_atimespec.tv_nsec = archive_entry_atime_nsec(entry); in archive_entry_stat() 86 st->st_ctimespec.tv_nsec = archive_entry_ctime_nsec(entry); in archive_entry_stat() 87 st->st_mtimespec.tv_nsec = archive_entry_mtime_nsec(entry); in archive_entry_stat() 89 st->st_atim.tv_nsec = archive_entry_atime_nsec(entry); in archive_entry_stat() 90 st->st_ctim.tv_nsec = archive_entry_ctime_nsec(entry); in archive_entry_stat() 91 st->st_mtim.tv_nsec = archive_entry_mtime_nsec(entry); in archive_entry_stat() 106 st->st_birthtimespec.tv_nsec = archive_entry_birthtime_nsec(entry); in archive_entry_stat()
|
/freebsd/sys/sys/ |
H A D | time.h | 296 _ts->tv_nsec = __utime64_scale64_floor( in bintime2timespec() 317 (uint64_t)_ts->tv_nsec << 32, 1ULL << 32, 1000000000); in timespec2bintime() 344 _ts.tv_nsec = sbttons((uint32_t)_sbt); in sbttots() 352 return (((sbintime_t)_ts.tv_sec << 32) + nstosbt(_ts.tv_nsec)); in tstosbt() 393 #define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) 394 #define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec) 397 ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ 403 (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ 404 if ((vsp)->tv_nsec >= 1000000000L) { \ 406 (vsp)->tv_nsec -= 1000000000L; \ [all …]
|