diff options
author | Yang Xu <xuyang2018.jy@cn.fujitsu.com> | 2019-04-11 17:12:05 +0800 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2019-04-11 12:32:59 +0200 |
commit | e5563a4f43149cbd12401565541c3c39a7fe89a4 (patch) | |
tree | a576ba6f58a88a5f6e476ce45e381f08ce787b99 /include | |
parent | 044c72698f650fd174bf6bcae3b4ace3067f4d57 (diff) |
syscalls/clock_adjtime: Fix compiler error
'ADJ_OFFSET_SS_READ' 'ADJ_NANO' 'STA_NANO' and 'ADJ_MICRO' are not defined on
some old distros, so add them into a new 'include/lapi/timex.h' to fix it.
Also move ADJ_ALL macro into this new header file.
These macros are introduced by the following commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=52bfb36
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eea83d8
sys_clock_adjtime are introduced by the following commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=339dc
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/lapi/posix_clocks.h | 4 | ||||
-rw-r--r-- | include/lapi/timex.h | 30 |
2 files changed, 30 insertions, 4 deletions
diff --git a/include/lapi/posix_clocks.h b/include/lapi/posix_clocks.h index b1f7a7c55..4914479ac 100644 --- a/include/lapi/posix_clocks.h +++ b/include/lapi/posix_clocks.h @@ -11,10 +11,6 @@ #define MAX_CLOCKS 16 -#define ADJ_ALL (ADJ_OFFSET | ADJ_FREQUENCY | ADJ_MAXERROR | \ - ADJ_ESTERROR | ADJ_STATUS | ADJ_TIMECONST | \ - ADJ_TICK) - #ifndef CLOCK_MONOTONIC_RAW # define CLOCK_MONOTONIC_RAW 4 #endif diff --git a/include/lapi/timex.h b/include/lapi/timex.h new file mode 100644 index 000000000..c2c9e4d8d --- /dev/null +++ b/include/lapi/timex.h @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. + * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com> + */ + +#ifndef LAPI_TIMEX_H__ +# define LAPI_TIMEX_H__ + +#define ADJ_ALL (ADJ_OFFSET | ADJ_FREQUENCY | ADJ_MAXERROR | \ + ADJ_ESTERROR | ADJ_STATUS | ADJ_TIMECONST | \ + ADJ_TICK) + +#ifndef ADJ_OFFSET_SS_READ +# define ADJ_OFFSET_SS_READ 0xa001 +#endif + +#ifndef ADJ_NANO +# define ADJ_NANO 0x2000 +#endif + +#ifndef STA_NANO +# define STA_NANO 0x2000 +#endif + +#ifndef ADJ_MICRO +# define ADJ_MICRO 0x1000 +#endif + +#endif/* LAPI_TIMEX_H__ */ |