Lines Matching +full:tx +full:- +full:sec

9  *  Usage: valid-adjtimex
12 * $ gcc valid-adjtimex.c -o valid-adjtimex -lrt
40 int clock_adjtime(clockid_t id, struct timex *tx) in clock_adjtime() argument
42 return syscall(__NR_clock_adjtime, id, tx); in clock_adjtime()
49 struct timex tx; in clear_time_state() local
52 tx.modes = ADJ_STATUS; in clear_time_state()
53 tx.status = 0; in clear_time_state()
54 ret = adjtimex(&tx); in clear_time_state()
65 -499 * SHIFTED_PPM,
66 -450 * SHIFTED_PPM,
67 -400 * SHIFTED_PPM,
68 -350 * SHIFTED_PPM,
69 -300 * SHIFTED_PPM,
70 -250 * SHIFTED_PPM,
71 -200 * SHIFTED_PPM,
72 -150 * SHIFTED_PPM,
73 -100 * SHIFTED_PPM,
74 -75 * SHIFTED_PPM,
75 -50 * SHIFTED_PPM,
76 -25 * SHIFTED_PPM,
77 -10 * SHIFTED_PPM,
78 -5 * SHIFTED_PPM,
79 -1 * SHIFTED_PPM,
80 -1000,
99 -1000 * SHIFTED_PPM,
100 -550 * SHIFTED_PPM,
106 #define LONG_MIN (-LONG_MAX - 1)
115 struct timex tx; in validate_freq() local
121 memset(&tx, 0, sizeof(struct timex)); in validate_freq()
127 tx.modes = ADJ_FREQUENCY; in validate_freq()
128 tx.freq = valid_freq[i]; in validate_freq()
130 ret = adjtimex(&tx); in validate_freq()
133 printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n", in validate_freq()
135 pass = -1; in validate_freq()
138 tx.modes = 0; in validate_freq()
139 ret = adjtimex(&tx); in validate_freq()
140 if (tx.freq != valid_freq[i]) { in validate_freq()
142 tx.freq, valid_freq[i]); in validate_freq()
146 tx.modes = ADJ_FREQUENCY; in validate_freq()
147 tx.freq = outofrange_freq[i]; in validate_freq()
149 ret = adjtimex(&tx); in validate_freq()
152 printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n", in validate_freq()
154 pass = -1; in validate_freq()
157 tx.modes = 0; in validate_freq()
158 ret = adjtimex(&tx); in validate_freq()
159 if (tx.freq == outofrange_freq[i]) { in validate_freq()
162 tx.freq); in validate_freq()
163 pass = -1; in validate_freq()
171 tx.modes = ADJ_FREQUENCY; in validate_freq()
172 tx.freq = invalid_freq[i]; in validate_freq()
173 ret = adjtimex(&tx); in validate_freq()
178 pass = -1; in validate_freq()
187 tx.modes = ADJ_FREQUENCY; in validate_freq()
188 tx.freq = 0; in validate_freq()
189 ret = adjtimex(&tx); in validate_freq()
208 tmx.time.tv_sec -= 1; in set_offset()
216 tmx.time.tv_sec -= 1; in set_offset()
223 printf("(sec: %ld usec: %ld) ", tmx.time.tv_sec, tmx.time.tv_usec); in set_offset()
225 return -1; in set_offset()
230 int set_bad_offset(long sec, long usec, int use_nano) in set_bad_offset() argument
239 tmx.time.tv_sec = sec; in set_bad_offset()
243 printf("Invalid (sec: %ld usec: %ld) did not fail! ", tmx.time.tv_sec, tmx.time.tv_usec); in set_bad_offset()
245 return -1; in set_bad_offset()
256 if (set_offset(NSEC_PER_SEC - 1, 1)) in validate_set_offset()
257 return -1; in validate_set_offset()
259 if (set_offset(-NSEC_PER_SEC + 1, 1)) in validate_set_offset()
260 return -1; in validate_set_offset()
262 if (set_offset(-NSEC_PER_SEC - 1, 1)) in validate_set_offset()
263 return -1; in validate_set_offset()
266 return -1; in validate_set_offset()
268 if (set_offset(-5 * NSEC_PER_SEC, 1)) in validate_set_offset()
269 return -1; in validate_set_offset()
272 return -1; in validate_set_offset()
274 if (set_offset(-5 * NSEC_PER_SEC - NSEC_PER_SEC / 2, 1)) in validate_set_offset()
275 return -1; in validate_set_offset()
277 if (set_offset(USEC_PER_SEC - 1, 0)) in validate_set_offset()
278 return -1; in validate_set_offset()
280 if (set_offset(-USEC_PER_SEC + 1, 0)) in validate_set_offset()
281 return -1; in validate_set_offset()
283 if (set_offset(-USEC_PER_SEC - 1, 0)) in validate_set_offset()
284 return -1; in validate_set_offset()
287 return -1; in validate_set_offset()
289 if (set_offset(-5 * USEC_PER_SEC, 0)) in validate_set_offset()
290 return -1; in validate_set_offset()
293 return -1; in validate_set_offset()
295 if (set_offset(-5 * USEC_PER_SEC - USEC_PER_SEC / 2, 0)) in validate_set_offset()
296 return -1; in validate_set_offset()
299 if (set_bad_offset(0, -1, 1)) in validate_set_offset()
300 return -1; in validate_set_offset()
301 if (set_bad_offset(0, -1, 0)) in validate_set_offset()
302 return -1; in validate_set_offset()
304 return -1; in validate_set_offset()
306 return -1; in validate_set_offset()
308 return -1; in validate_set_offset()
310 return -1; in validate_set_offset()
311 if (set_bad_offset(0, -NSEC_PER_SEC, 1)) in validate_set_offset()
312 return -1; in validate_set_offset()
313 if (set_bad_offset(0, -USEC_PER_SEC, 0)) in validate_set_offset()
314 return -1; in validate_set_offset()