Lines Matching defs:tv
64 fix_tv_usec(struct timeval *tv) {
67 if (tv->tv_usec < 0) {
70 tv->tv_sec -= 1;
71 tv->tv_usec += US_PER_S;
72 } while (tv->tv_usec < 0);
73 } else if (tv->tv_usec >= US_PER_S) {
76 tv->tv_sec += 1;
77 tv->tv_usec -= US_PER_S;
78 } while (tv->tv_usec >=US_PER_S);
149 struct timeval tv;
154 if (gettimeofday(&tv, NULL) == -1) {
168 fix_tv_usec(&tv);
169 if (tv.tv_sec < 0)
172 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
179 if (sizeof(tv.tv_sec) > sizeof(t->seconds) &&
180 ((tv.tv_sec | (unsigned int)-1) ^ (unsigned int)-1) != 0U)
183 t->seconds = tv.tv_sec;
184 t->nanoseconds = tv.tv_usec * NS_PER_US;
191 struct timeval tv;
198 if (gettimeofday(&tv, NULL) == -1) {
212 fix_tv_usec(&tv);
213 if (tv.tv_sec < 0)
216 if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
226 if ((tv.tv_sec > INT_MAX || i->seconds > INT_MAX) &&
227 ((long long)tv.tv_sec + i->seconds > UINT_MAX))
230 t->seconds = tv.tv_sec + i->seconds;
231 t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds;