This is the mail archive of the 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_getres_time64

On Wed, 19 Sep 2018, Albert ARIBAUD (3ADEV) wrote:

> @@ -23,12 +23,11 @@
>  #include <sys/param.h>
>  #include <libc-internal.h>
> -

Please avoid spurious diff hunks adding or removing whitespace like this.

> +int
> +__clock_getres (clockid_t clock_id, struct timespec *res)
> +{
> +  struct __timespec64 ts64;
> +  int retval = __clock_getres_time64 (clock_id, &ts64);
> +  if (retval == 0)
> +    {
> +      // We assume we never run with a CPU clock period greater than
> +      // 2**31 seconds and therefore we do not check the seconds field

Comments in glibc should use /* */, not //.  All comments should end with 
".".  Please check for and fix such issues throughout the patch series.  
There are several others in this patch.

> +      res->tv_sec = ts64.tv_sec;
> +      res->tv_nsec = ts64.tv_nsec;
> +    }
> +  return retval;

Generically, it is important that on systems where time_t is already 
64-bit, no additional conversion code or function calls get built into 
glibc; the abstractions used at the source code level must be completely 
optimized away in that case (whether through use of #if etc. to control 
what gets built and what functions are aliases of what other functions, or 
through arranging the code so it can and does all get inlined in that 
case, etc.).

Please, in each patch posting, include details of the configurations for 
which it was tested for the full glibc testsuite (which should include at 
least one 32-bit and one 64-bit configuration).  You should also include 
explicit confirmation of how the code ensures no additional speed or size 
overhead for configurations where time_t is already 64-bit.

Joseph S. Myers

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