Lines Matching refs:tv
62 fix_tv_usec(struct timeval *tv) {
65 if (tv->tv_usec < 0) {
68 tv->tv_sec -= 1;
69 tv->tv_usec += US_PER_S;
70 } while (tv->tv_usec < 0);
71 } else if (tv->tv_usec >= US_PER_S) {
74 tv->tv_sec += 1;
75 tv->tv_usec -= US_PER_S;
76 } while (tv->tv_usec >=US_PER_S);
147 struct timeval tv;
152 if (gettimeofday(&tv, NULL) == -1) {
166 fix_tv_usec(&tv);
167 if (tv.tv_sec < 0)
170 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
177 if (sizeof(tv.tv_sec) > sizeof(t->seconds) &&
178 ((tv.tv_sec | (unsigned int)-1) ^ (unsigned int)-1) != 0U)
181 t->seconds = tv.tv_sec;
182 t->nanoseconds = tv.tv_usec * NS_PER_US;
189 struct timeval tv;
196 if (gettimeofday(&tv, NULL) == -1) {
210 fix_tv_usec(&tv);
211 if (tv.tv_sec < 0)
214 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
224 if ((tv.tv_sec > INT_MAX || i->seconds > INT_MAX) &&
225 ((long long)tv.tv_sec + i->seconds > UINT_MAX))
228 t->seconds = tv.tv_sec + i->seconds;
229 t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds;