Line
Link Here
|
0 |
-- sysdeps/unix/sysv/linux/ntp_gettime.c |
0 |
++ sysdeps/unix/sysv/linux/ntp_gettime.c |
Lines 38-42
Link Here
|
38 |
ntv->time = tntx.time; |
38 |
ntv->time = tntx.time; |
39 |
ntv->maxerror = tntx.maxerror; |
39 |
ntv->maxerror = tntx.maxerror; |
40 |
ntv->esterror = tntx.esterror; |
40 |
ntv->esterror = tntx.esterror; |
|
|
41 |
ntv->tai = tntx.tai; |
41 |
return result; |
42 |
return result; |
42 |
} |
43 |
} |
43 |
-- sysdeps/unix/sysv/linux/sys/timex.h |
44 |
++ sysdeps/unix/sysv/linux/sys/timex.h |
Lines 22-34
Link Here
|
22 |
#include <features.h> |
22 |
#include <features.h> |
23 |
#include <sys/time.h> |
23 |
#include <sys/time.h> |
24 |
|
24 |
|
25 |
/* These definitions from linux/timex.h as of 2.2.0. */ |
25 |
/* These definitions from linux/timex.h as of 2.6.26. */ |
|
|
26 |
|
27 |
#define NTP_API 4 /* NTP API version */ |
26 |
|
28 |
|
27 |
struct ntptimeval |
29 |
struct ntptimeval |
28 |
{ |
30 |
{ |
29 |
struct timeval time; /* current time (ro) */ |
31 |
struct timeval time; /* current time (ro) */ |
30 |
long int maxerror; /* maximum error (us) (ro) */ |
32 |
long int maxerror; /* maximum error (us) (ro) */ |
31 |
long int esterror; /* estimated error (us) (ro) */ |
33 |
long int esterror; /* estimated error (us) (ro) */ |
|
|
34 |
long tai; /* TAI offset (ro) */ |
32 |
}; |
35 |
}; |
33 |
|
36 |
|
34 |
struct timex |
37 |
struct timex |
Lines 54-63
Link Here
|
54 |
long int errcnt; /* calibration errors (ro) */ |
57 |
long int errcnt; /* calibration errors (ro) */ |
55 |
long int stbcnt; /* stability limit exceeded (ro) */ |
58 |
long int stbcnt; /* stability limit exceeded (ro) */ |
56 |
|
59 |
|
|
|
60 |
int tai; /* TAI offset (ro) */ |
61 |
|
57 |
/* ??? */ |
62 |
/* ??? */ |
58 |
int :32; int :32; int :32; int :32; |
63 |
int :32; int :32; int :32; int :32; |
59 |
int :32; int :32; int :32; int :32; |
64 |
int :32; int :32; int :32; int :32; |
60 |
int :32; int :32; int :32; int :32; |
65 |
int :32; int :32; int :32; |
61 |
}; |
66 |
}; |
62 |
|
67 |
|
63 |
/* Mode codes (timex.mode) */ |
68 |
/* Mode codes (timex.mode) */ |
Lines 67-72
Link Here
|
67 |
#define ADJ_ESTERROR 0x0008 /* estimated time error */ |
72 |
#define ADJ_ESTERROR 0x0008 /* estimated time error */ |
68 |
#define ADJ_STATUS 0x0010 /* clock status */ |
73 |
#define ADJ_STATUS 0x0010 /* clock status */ |
69 |
#define ADJ_TIMECONST 0x0020 /* pll time constant */ |
74 |
#define ADJ_TIMECONST 0x0020 /* pll time constant */ |
|
|
75 |
#define ADJ_TAI 0x0080 /* set TAI offset */ |
76 |
#define ADJ_MICRO 0x1000 /* select microsecond resolution */ |
77 |
#define ADJ_NANO 0x2000 /* select nanosecond resolution */ |
70 |
#define ADJ_TICK 0x4000 /* tick value */ |
78 |
#define ADJ_TICK 0x4000 /* tick value */ |
71 |
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ |
79 |
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ |
72 |
|
80 |
|
Lines 77-84
Link Here
|
77 |
#define MOD_ESTERROR ADJ_ESTERROR |
85 |
#define MOD_ESTERROR ADJ_ESTERROR |
78 |
#define MOD_STATUS ADJ_STATUS |
86 |
#define MOD_STATUS ADJ_STATUS |
79 |
#define MOD_TIMECONST ADJ_TIMECONST |
87 |
#define MOD_TIMECONST ADJ_TIMECONST |
80 |
#define MOD_CLKB ADJ_TICK |
88 |
#define MOD_TAI ADJ_TAI |
81 |
#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */ |
89 |
#define MOD_MICRO ADJ_MICRO |
|
|
90 |
#define MOD_NANO ADJ_NANO |
82 |
|
91 |
|
83 |
|
92 |
|
84 |
/* Status codes (timex.status) */ |
93 |
/* Status codes (timex.status) */ |
Lines 98-106
Link Here
|
98 |
#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ |
107 |
#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ |
99 |
|
108 |
|
100 |
#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ |
109 |
#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ |
|
|
110 |
#define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ |
111 |
#define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ |
112 |
#define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ |
101 |
|
113 |
|
102 |
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ |
114 |
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ |
103 |
STA_PPSERROR | STA_CLOCKERR) /* read-only bits */ |
115 |
STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) |
104 |
|
116 |
|
105 |
/* Clock states (time_state) */ |
117 |
/* Clock states (time_state) */ |
106 |
#define TIME_OK 0 /* clock synchronized, no leap second */ |
118 |
#define TIME_OK 0 /* clock synchronized, no leap second */ |