syscalls/clock_adjtime: Fix compiler error
PATCH 1/1 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 'include/lapi/posix_clocks.h' to fix it.
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=339dc50
--- include/lapi/posix_clocks.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/lapi/posix_clocks.h +16 -0
@@ -39,4 +39,20 @@# define CLOCK_BOOTTIME_ALARM 9#endif +#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 /* POSIX_CLOCKS_H__ */
Signature · 1 line
2.18.1
PATCH 1/1 syscalls/clock_adjtime: Fix compiler error
Hi!
Quoted 28 lines
'
ADJ_OFFSET_SS_READ' 'ADJ_NANO' 'STA_NANO' and 'ADJ_MICRO' are not defined on some old distros, so add them into 'include/lapi/posix_clocks.h' to fix it.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_adjtimeare introduced by the following commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=339dc50Signed-off-by Yang Xu <[email protected]>--- include/lapi/posix_clocks.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/lapi/posix_clocks.h +5
-0@@ -39,4 +39,20 @@# define CLOCK_BOOTTIME_ALARM 9#endif +#ifndef ADJ_OFFSET_SS_READ +# define ADJ_OFFSET_SS_READ 0xa001 +#endif + +#ifndef ADJ_NANO
include/lapi/posix_clocks.h line 56
Quoted 10 lines
include/lapi/posix_clocks.h +10
-0+# define ADJ_NANO 0x2000 +#endif + +#ifndef STA_NANO +# define STA_NANO 0x2000 +#endif + +#ifndef ADJ_MICRO +# define ADJ_MICRO 0x1000 +#endif
Can we start a new header in the lapi called timex.h and put these there? Other than that this looks good.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 syscalls/clock_adjtime: Fix compiler error
Quoted 33 lines · Cyril Hrubis
Hi!
Quoted 32 lines
'
ADJ_OFFSET_SS_READ' 'ADJ_NANO' 'STA_NANO' and 'ADJ_MICRO' are not defined on some old distros, so add them into 'include/lapi/posix_clocks.h' to fix it.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_adjtimeare introduced by the following commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=339dc50Signed-off-by Yang Xu<[email protected]>--- include/lapi/posix_clocks.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/lapi/posix_clocks.h +9
-0@@ -39,4 +39,20 @@# define CLOCK_BOOTTIME_ALARM 9#endif +#ifndef ADJ_OFFSET_SS_READ +# define ADJ_OFFSET_SS_READ 0xa001 +#endif + +#ifndef ADJ_NANO +# define ADJ_NANO 0x2000 +#endif + +#ifndef STA_NANO
Quoted 9 lines
include/lapi/posix_clocks.h line 56
Quoted 6 lines
include/lapi/posix_clocks.h +6
-0+# define STA_NANO 0x2000 +#endif + +#ifndef ADJ_MICRO +# define ADJ_MICRO 0x1000 +#endif Can we start a new header in the lapi called
timex.hand put these there? Other than that this looks good.
I forget this. OK ,I will move it into a new header called timex.h.
PATCH v2 1/1 syscalls/clock_adjtime: Fix compiler error
In reply to Cyril Hrubis'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
--- include/lapi/posix_clocks.h | 4 --- include/lapi/timex.h | 30 +++++++++++++++++++ .../syscalls/clock_adjtime/clock_adjtime.h | 1 + 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 include/lapi/timex.h
include/lapi/posix_clocks.h +0 -4
@@ -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
include/lapi/timex.h new file +30 -0
@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. +* Author: Yang Xu <[email protected]> +*/ + +#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__ */
testcases/kernel/syscalls/clock_adjtime/clock_adjtime.h +1 -0
@@ -14,6 +14,7 @@#include <pwd.h> #include <sys/timex.h> #include <sys/types.h> +#include "lapi/timex.h" static int sys_clock_adjtime (clockid_t ,struct timex *);static void timex_show (char *,struct timex );
Signature · 1 line
2.18.1
PATCH v2 1/1 syscalls/clock_adjtime: Fix compiler error
Hi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]