Lines Matching defs:tv
57 fix_tv_usec(struct timeval *tv) {
60 if (tv->tv_usec < 0) {
63 tv->tv_sec -= 1;
64 tv->tv_usec += US_PER_S;
65 } while (tv->tv_usec < 0);
66 } else if (tv->tv_usec >= US_PER_S) {
69 tv->tv_sec += 1;
70 tv->tv_usec -= US_PER_S;
71 } while (tv->tv_usec >=US_PER_S);
142 struct timeval tv;
147 if (gettimeofday(&tv, NULL) == -1) {
161 fix_tv_usec(&tv);
162 if (tv.tv_sec < 0)
165 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
172 if (sizeof(tv.tv_sec) > sizeof(t->seconds) &&
173 ((tv.tv_sec | (unsigned int)-1) ^ (unsigned int)-1) != 0U)
176 t->seconds = tv.tv_sec;
177 t->nanoseconds = tv.tv_usec * NS_PER_US;
184 struct timeval tv;
191 if (gettimeofday(&tv, NULL) == -1) {
205 fix_tv_usec(&tv);
206 if (tv.tv_sec < 0)
209 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
219 if ((tv.tv_sec > INT_MAX || i->seconds > INT_MAX) &&
220 ((long long)tv.tv_sec + i->seconds > UINT_MAX))
223 t->seconds = tv.tv_sec + i->seconds;
224 t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds;