]> sourceware.org Git - glibc.git/blob - sysdeps/unix/sysv/linux/sys/timex.h
Add clock_adjtime syscall.
[glibc.git] / sysdeps / unix / sysv / linux / sys / timex.h
1 /* Copyright (C) 1995-1997,1999,2007,2009,2011 Free Software Foundation, Inc.
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
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.
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
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
18
19 #ifndef _SYS_TIMEX_H
20 #define _SYS_TIMEX_H 1
21
22 #include <features.h>
23 #include <sys/time.h>
24
25 /* These definitions from linux/timex.h as of 2.6.30. */
26
27 #include <bits/timex.h>
28
29 #define NTP_API 4 /* NTP API version */
30
31 struct ntptimeval
32 {
33 struct timeval time; /* current time (ro) */
34 long int maxerror; /* maximum error (us) (ro) */
35 long int esterror; /* estimated error (us) (ro) */
36 long int tai; /* TAI offset (ro) */
37
38 long int __unused1;
39 long int __unused2;
40 long int __unused3;
41 long int __unused4;
42 };
43
44 /* Clock states (time_state) */
45 #define TIME_OK 0 /* clock synchronized, no leap second */
46 #define TIME_INS 1 /* insert leap second */
47 #define TIME_DEL 2 /* delete leap second */
48 #define TIME_OOP 3 /* leap second in progress */
49 #define TIME_WAIT 4 /* leap second has occurred */
50 #define TIME_ERROR 5 /* clock not synchronized */
51 #define TIME_BAD TIME_ERROR /* bw compat */
52
53 /* Maximum time constant of the PLL. */
54 #define MAXTC 6
55
56 __BEGIN_DECLS
57
58 extern int __adjtimex (struct timex *__ntx) __THROW;
59 extern int adjtimex (struct timex *__ntx) __THROW;
60
61 #ifdef __REDIRECT_NTH
62 extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
63 ntp_gettimex);
64 #else
65 extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
66 # define ntp_gettime ntp_gettimex
67 #endif
68 extern int ntp_adjtime (struct timex *__tntx) __THROW;
69
70 __END_DECLS
71
72 #endif /* sys/timex.h */
This page took 0.036558 seconds and 5 git commands to generate.