Rev | Author | # | Line |
---|---|---|---|
1 | perry | 1 | ADJTIMEX |
2 | !!!ADJTIMEX | ||
2 | PerryLorier | 3 | |
1 | perry | 4 | ---- |
5 | !!NAME | ||
6 | |||
7 | |||
8 | adjtimex - tune kernel clock | ||
9 | !!SYNOPSIS | ||
10 | |||
2 | PerryLorier | 11 | __#include <sys/time> |
12 | __int adjtimex(struct timex *__''buf''__);__ | ||
1 | perry | 13 | |
14 | !!DESCRIPTION | ||
15 | |||
16 | Linux uses David L. Mills' clock adjustment algorithm (see | ||
17 | RFC 1305). The system call __adjtimex__ reads and | ||
18 | optionally sets adjustment parameters for this algorithm. It | ||
19 | takes a pointer to a ''timex'' structure, updates kernel | ||
20 | parameters from field values, and returns the same structure | ||
21 | with current kernel values. This structure is declared as | ||
22 | follows: | ||
23 | |||
2 | PerryLorier | 24 | struct timex { |
25 | int modes; /* mode selector */ | ||
26 | long offset; /* time offset (usec) */ | ||
27 | long freq; /* frequency offset (scaled ppm) */ | ||
28 | long maxerror; /* maximum error (usec) */ | ||
29 | long esterror; /* estimated error (usec) */ | ||
30 | int status; /* clock command/status */ | ||
31 | long constant; /* pll time constant */ | ||
32 | long precision; /* clock precision (usec) (read only) */ | ||
33 | long tolerance; /* clock frequency tolerance (ppm) (read only) */ | ||
34 | struct timeval time; /* current time (read only) */ | ||
35 | long tick; /* usecs between clock ticks */ | ||
36 | }; | ||
1 | perry | 37 | |
38 | The ''modes'' field determines which parameters, if any, | ||
39 | to set. It may contain a bitwise-''or'' combination of | ||
40 | zero or more of the following bits: | ||
41 | |||
2 | PerryLorier | 42 | #define ADJ_OFFSET 0x0001 /* time offset */ |
43 | #define ADJ_FREQUENCY 0x0002 /* frequency offset */ | ||
44 | #define ADJ_MAXERROR 0x0004 /* maximum time error */ | ||
45 | #define ADJ_ESTERROR 0x0008 /* estimated time error */ | ||
46 | #define ADJ_STATUS 0x0010 /* clock status */ | ||
47 | #define ADJ_TIMECONST 0x0020 /* pll time constant */ | ||
48 | #define ADJ_TICK 0x4000 /* tick value */ | ||
49 | #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ | ||
1 | perry | 50 | |
2 | PerryLorier | 51 | Ordinary users are restricted to a zero value for ''mode''. Only the superuser may set any parameters. |
1 | perry | 52 | !!RETURN VALUE |
53 | |||
2 | PerryLorier | 54 | On success, __adjtimex__ returns the clock state: |
1 | perry | 55 | |
2 | PerryLorier | 56 | #define TIME_OK 0 /* clock synchronized */ |
57 | #define TIME_INS 1 /* insert leap second */ | ||
58 | #define TIME_DEL 2 /* delete leap second */ | ||
59 | #define TIME_OOP 3 /* leap second in progress */ | ||
60 | #define TIME_WAIT 4 /* leap second has occurred */ | ||
61 | #define TIME_BAD 5 /* clock not synchronized */ | ||
1 | perry | 62 | |
63 | |||
2 | PerryLorier | 64 | On failure, __adjtimex__ returns -1 and sets ''errno''. |
1 | perry | 65 | !!ERRORS |
66 | |||
67 | |||
2 | PerryLorier | 68 | ;[EFAULT]: ''buf'' does not point to writable memory. |
69 | ;[EPERM]: ''buf.mode'' is non-zero and the user is not super-user. | ||
70 | ;[EINVAL]: An attempt is made to set ''buf.offset'' to a value outside the range -131071 to +131071, or to set ''buf.status'' to a value other than those listed above, or to set ''buf.tick'' to a value outside the range 900000/__HZ__ to 1100000/__HZ__, where __HZ__ is the system timer interrupt frequency. | ||
1 | perry | 71 | !!CONFORMING TO |
72 | |||
73 | __adjtimex__ is Linux specific and should not be used in | ||
74 | programs intended to be portable. There is a similar but | ||
75 | less general call __adjtime__ in SVr4. | ||
2 | PerryLorier | 76 | |
1 | perry | 77 | !!SEE ALSO |
78 | |||
79 | settimeofday(2) | ||
80 | ---- |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 4 times)