Lines Matching refs:now
37 static const char *strtime(const struct timespec *now)
41 if (snprintf(fmt, sizeof(fmt), "%%T.%09ld", now->tv_nsec) < 0) {
45 if (!strftime(buf, sizeof(buf), fmt, localtime(&now->tv_sec))) {
75 struct timespec now;
80 now.tv_sec = tx->time.tv_sec;
81 now.tv_nsec = tx->time.tv_usec * 1000;
88 tst_res(TINFO, "%s adjtimex: %s", strtime(&now), msgs[ret]);
91 strtime(&now), ret);
96 struct timespec now, target;
99 SAFE_CLOCK_GETTIME(CLOCK_REALTIME, &now);
100 tst_res(TINFO, "now is %s", strtime(&now));
102 target = now;
111 SAFE_CLOCK_GETTIME(CLOCK_REALTIME, &now);
112 tst_res(TINFO, "now is %s", strtime(&now));
114 if (in_order(target, now)) {
125 struct timespec now, leap, start;
128 SAFE_CLOCK_GETTIME(CLOCK_REALTIME, &now);
129 start = now;
130 tst_res(TINFO, "test start at %s", strtime(&now));
135 now.tv_sec += 86400 - now.tv_sec % 86400;
136 now.tv_nsec = 0;
137 leap = now;
141 now.tv_sec -= SECONDS_BEFORE_LEAP;
142 SAFE_CLOCK_SETTIME(CLOCK_REALTIME, &now);
144 tst_res(TINFO, "setting time to %s", strtime(&now));
165 SAFE_CLOCK_GETTIME(CLOCK_REALTIME, &now);
166 start.tv_sec += now.tv_sec - (leap.tv_sec - SECONDS_BEFORE_LEAP);
167 start.tv_nsec += now.tv_nsec;
190 struct timespec now;
192 SAFE_CLOCK_GETTIME(CLOCK_REALTIME, &now);
195 SAFE_CLOCK_SETTIME(CLOCK_REALTIME, &now);