This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Y2038: add function __clock_gettime64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]