This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Y2038: add function __clock_gettime64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Albert ARIBAUD (3ADEV)" <albert dot aribaud at 3adev dot fr>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 19 Sep 2018 13:13:49 +0000
- Subject: Re: [PATCH] Y2038: add function __clock_gettime64
- References: <20180919073400.27947-1-albert.aribaud@3adev.fr>
On Wed, 19 Sep 2018, Albert ARIBAUD (3ADEV) wrote:
> + set_errno(EOVERFLOW);
Note GNU style has a space before the open parenthesis.
> +# define DO_CLOCK_GETTIME_64 \
> + if (__y2038_linux_support > 0) \
> + { \
> + retval = INLINE_SYSCALL (clock_gettime64, 2, clock_id, tp); \
> + if (retval == -1 && errno == ENOSYS) \
> + { \
> + __y2038_linux_support = -1; \
> + DO_CLOCK_GETTIME_32; \
> + } \
> + } \
> + else \
> + { \
> + DO_CLOCK_GETTIME_32; \
> + }
Such macros need to be designed in such a way that the runtime ENOSYS
check, and the assignment to __y2038_linux_support, are optimized away at
compile time given the __ASSUME_* macro for the 64-bit time syscalls.
--
Joseph S. Myers
joseph@codesourcery.com