]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1998-2019 Free Software Foundation, Inc. |
d958c121 UD |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
3214b89b AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
d958c121 UD |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
3214b89b | 12 | Lesser General Public License for more details. |
d958c121 | 13 | |
3214b89b | 14 | You should have received a copy of the GNU Lesser General Public |
ab84e3ff | 15 | License along with the GNU C Library. If not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
d958c121 | 17 | |
0772663d | 18 | #include <shlib-compat.h> |
ebcd2cd1 RH |
19 | #include <sysdep.h> |
20 | #include <sys/time.h> | |
0772663d | 21 | |
1c371814 RH |
22 | |
23 | #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) | |
d958c121 UD |
24 | struct timeval32 |
25 | { | |
26 | int tv_sec, tv_usec; | |
27 | }; | |
28 | ||
29 | struct timex32 { | |
30 | unsigned int modes; /* mode selector */ | |
31 | long offset; /* time offset (usec) */ | |
32 | long freq; /* frequency offset (scaled ppm) */ | |
33 | long maxerror; /* maximum error (usec) */ | |
34 | long esterror; /* estimated error (usec) */ | |
35 | int status; /* clock command/status */ | |
36 | long constant; /* pll time constant */ | |
37 | long precision; /* clock precision (usec) (read only) */ | |
38 | long tolerance; /* clock frequency tolerance (ppm) | |
39 | * (read only) | |
40 | */ | |
41 | struct timeval32 time; /* (read only) */ | |
42 | long tick; /* (modified) usecs between clock ticks */ | |
43 | ||
44 | long ppsfreq; /* pps frequency (scaled ppm) (ro) */ | |
45 | long jitter; /* pps jitter (us) (ro) */ | |
46 | int shift; /* interval duration (s) (shift) (ro) */ | |
47 | long stabil; /* pps stability (scaled ppm) (ro) */ | |
48 | long jitcnt; /* jitter limit exceeded (ro) */ | |
49 | long calcnt; /* calibration intervals (ro) */ | |
50 | long errcnt; /* calibration errors (ro) */ | |
51 | long stbcnt; /* stability limit exceeded (ro) */ | |
52 | ||
53 | int :32; int :32; int :32; int :32; | |
54 | int :32; int :32; int :32; int :32; | |
55 | int :32; int :32; int :32; int :32; | |
56 | }; | |
57 | ||
58 | #define TIMEVAL timeval32 | |
59 | #define TIMEX timex32 | |
36727f22 | 60 | #define ADJTIME attribute_compat_text_section __adjtime_tv32 |
ebcd2cd1 | 61 | #define ADJTIMEX(x) INLINE_SYSCALL (old_adjtimex, 1, x) |
cfbf1a2f | 62 | #define ADJTIMEX32(x) INLINE_SYSCALL (old_adjtimex, 1, x) |
d958c121 UD |
63 | |
64 | #include <sysdeps/unix/sysv/linux/adjtime.c> | |
65 | ||
1c371814 | 66 | int attribute_compat_text_section |
36727f22 | 67 | __adjtimex_tv32 (struct timex32 *tx) { return ADJTIMEX (tx); } |
1c371814 | 68 | |
ebcd2cd1 RH |
69 | strong_alias (__adjtimex_tv32, __adjtimex_tv32_1); |
70 | strong_alias (__adjtimex_tv32, __adjtimex_tv32_2); | |
71 | compat_symbol (libc, __adjtimex_tv32_1, __adjtimex, GLIBC_2_0); | |
72 | compat_symbol (libc, __adjtimex_tv32_2, adjtimex, GLIBC_2_0); | |
4a88ca46 | 73 | compat_symbol (libc, __adjtime_tv32, adjtime, GLIBC_2_0); |
1c371814 | 74 | #endif /* SHLIB_COMPAT */ |
d958c121 UD |
75 | |
76 | #undef TIMEVAL | |
d958c121 | 77 | #undef TIMEX |
1c371814 | 78 | #undef ADJTIME |
d958c121 | 79 | #undef ADJTIMEX |
1c371814 RH |
80 | #define TIMEVAL timeval |
81 | #define TIMEX timex | |
ebcd2cd1 | 82 | #define ADJTIMEX(x) INLINE_SYSCALL (adjtimex, 1, x) |
36f86ab9 | 83 | |
d958c121 | 84 | #include <sysdeps/unix/sysv/linux/adjtime.c> |
d958c121 UD |
85 | |
86 | int | |
1c371814 | 87 | __adjtimex_tv64 (struct timex *tx) { return ADJTIMEX (tx); } |
d958c121 | 88 | |
620f462e | 89 | libc_hidden_ver (__adjtimex_tv64, __adjtimex) |
d958c121 | 90 | strong_alias (__adjtimex_tv64, __adjtimex_tv64p); |
b8cce412 | 91 | weak_alias (__adjtimex_tv64, ntp_adjtime); |
0772663d UD |
92 | versioned_symbol (libc, __adjtimex_tv64, __adjtimex, GLIBC_2_1); |
93 | versioned_symbol (libc, __adjtimex_tv64p, adjtimex, GLIBC_2_1); | |
1c371814 | 94 | versioned_symbol (libc, __adjtime, adjtime, GLIBC_2_1); |