Lines Matching +full:tx +full:- +full:freq
9 * Usage: valid-adjtimex
12 * $ gcc valid-adjtimex.c -o valid-adjtimex -lrt
38 int clock_adjtime(clockid_t id, struct timex *tx)
40 return syscall(__NR_clock_adjtime, id, tx);
47 struct timex tx;
50 tx.modes = ADJ_STATUS;
51 tx.status = 0;
52 ret = adjtimex(&tx);
63 -499 * SHIFTED_PPM,
64 -450 * SHIFTED_PPM,
65 -400 * SHIFTED_PPM,
66 -350 * SHIFTED_PPM,
67 -300 * SHIFTED_PPM,
68 -250 * SHIFTED_PPM,
69 -200 * SHIFTED_PPM,
70 -150 * SHIFTED_PPM,
71 -100 * SHIFTED_PPM,
72 -75 * SHIFTED_PPM,
73 -50 * SHIFTED_PPM,
74 -25 * SHIFTED_PPM,
75 -10 * SHIFTED_PPM,
76 -5 * SHIFTED_PPM,
77 -1 * SHIFTED_PPM,
78 -1000,
97 -1000 * SHIFTED_PPM,
98 -550 * SHIFTED_PPM,
104 #define LONG_MIN (-LONG_MAX - 1)
113 struct timex tx;
119 memset(&tx, 0, sizeof(struct timex));
125 tx.modes = ADJ_FREQUENCY;
126 tx.freq = valid_freq[i];
128 ret = adjtimex(&tx);
131 printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n",
133 pass = -1;
136 tx.modes = 0;
137 ret = adjtimex(&tx);
138 if (tx.freq != valid_freq[i]) {
139 printf("Warning: freq value %ld not what we set it (%ld)!\n",
140 tx.freq, valid_freq[i]);
144 tx.modes = ADJ_FREQUENCY;
145 tx.freq = outofrange_freq[i];
147 ret = adjtimex(&tx);
150 printf("Error: adjtimex(ADJ_FREQ, %ld - %ld ppm\n",
152 pass = -1;
155 tx.modes = 0;
156 ret = adjtimex(&tx);
157 if (tx.freq == outofrange_freq[i]) {
160 tx.freq);
161 pass = -1;
169 tx.modes = ADJ_FREQUENCY;
170 tx.freq = invalid_freq[i];
171 ret = adjtimex(&tx);
176 pass = -1;
184 /* reset freq to zero */
185 tx.modes = ADJ_FREQUENCY;
186 tx.freq = 0;
187 ret = adjtimex(&tx);
206 tmx.time.tv_sec -= 1;
214 tmx.time.tv_sec -= 1;
223 return -1;
243 return -1;
254 if (set_offset(NSEC_PER_SEC - 1, 1))
255 return -1;
257 if (set_offset(-NSEC_PER_SEC + 1, 1))
258 return -1;
260 if (set_offset(-NSEC_PER_SEC - 1, 1))
261 return -1;
264 return -1;
266 if (set_offset(-5 * NSEC_PER_SEC, 1))
267 return -1;
270 return -1;
272 if (set_offset(-5 * NSEC_PER_SEC - NSEC_PER_SEC / 2, 1))
273 return -1;
275 if (set_offset(USEC_PER_SEC - 1, 0))
276 return -1;
278 if (set_offset(-USEC_PER_SEC + 1, 0))
279 return -1;
281 if (set_offset(-USEC_PER_SEC - 1, 0))
282 return -1;
285 return -1;
287 if (set_offset(-5 * USEC_PER_SEC, 0))
288 return -1;
291 return -1;
293 if (set_offset(-5 * USEC_PER_SEC - USEC_PER_SEC / 2, 0))
294 return -1;
297 if (set_bad_offset(0, -1, 1))
298 return -1;
299 if (set_bad_offset(0, -1, 0))
300 return -1;
302 return -1;
304 return -1;
306 return -1;
308 return -1;
309 if (set_bad_offset(0, -NSEC_PER_SEC, 1))
310 return -1;
311 if (set_bad_offset(0, -USEC_PER_SEC, 0))
312 return -1;