Hi Adhemerval, > On 26/04/2020 10:31, Lukasz Majewski wrote: > > The introduced glibc's 'internal' struct __timex64 is a copy of > > Linux kernel's struct __kernel_timex (v5.6) introduced for properly > > handling data for clock_adjtime64 syscall. > > As the struct's __kernel_timex size is the same as for archs with > > __WORDSIZE == 64, proper padding and data types conversion (i.e. > > long to long long) had to be added for architectures with > > __WORDSIZE == 32 && __TIMESIZE != 64. > > > > Moreover, it stores time in struct __timeval64 rather than struct > > timeval, which makes it Y2038-proof. > > > > Build tests: > > ./src/scripts/build-many-glibcs.py glibcs > > LGTM, with just two nits about code formatting and and type > specification. > > Reviewed-by: Adhemerval Zanella > > > --- > > sysdeps/unix/sysv/linux/include/sys/timex.h | 38 > > +++++++++++++++++++++ 1 file changed, 38 insertions(+) > > > > diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h > > b/sysdeps/unix/sysv/linux/include/sys/timex.h index > > 319d566608..f25081639b 100644 --- > > a/sysdeps/unix/sysv/linux/include/sys/timex.h +++ > > b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -25,5 +25,43 @@ > > > > libc_hidden_proto (__adjtimex) > > > > +# include > > +/* Local definition of 64 bit time supporting timex struct */ > > +# if __TIMESIZE == 64 > > +# define __timex64 timex > > +# else > > + > > +struct __timex64 > > +{ > > + unsigned int modes; /* mode selector */ > > + int :32; /* pad */ > > + long long offset; /* time offset (usec) */ > > + long long freq; /* frequency offset (scaled ppm) */ > > + long long maxerror; /* maximum error (usec) */ > > + long long esterror; /* estimated error (usec) */ > > + int status; /* clock command/status */ > > + int :32; /* pad */ > > + long long constant; /* pll time constant */ > > + long long precision; /* clock precision (usec) (read > > only) */ > > + long long tolerance; /* clock frequency tolerance (ppm) > > (ro) */ > > + struct __timeval64 time; /* (read only, except for > > ADJ_SETOFFSET) */ > > + long long tick; /* (modified) usecs between clock > > ticks */ > > + long long ppsfreq; /* pps frequency (scaled ppm) (ro) > > */ > > + long long jitter; /* pps jitter (us) (ro) */ > > + int shift; /* interval duration (s) (shift) > > (ro) */ > > + int :32; /* pad */ > > + long long stabil; /* pps stability (scaled ppm) (ro) > > */ > > + long long jitcnt; /* jitter limit exceeded (ro) */ > > + long long calcnt; /* calibration intervals (ro) */ > > + long long errcnt; /* calibration errors (ro) */ > > + long long stbcnt; /* stability limit exceeded (ro) */ > > + > > + int tai; /* TAI offset (ro) */ > > + > > + int :32; int :32; int :32; int :32; > > + int :32; int :32; int :32; int :32; > > + int :32; int :32; int :32; > > Not sure which is the code guidelines for unnamed bit fields, indent > places one field per line: > > [...] > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > int:32; > [...] > > > > +}; > > +# endif > > # endif /* _ISOMAC */ > > #endif /* sys/timex.h */ > > > > Use 'long long int' instead of 'long long'. I took the structure directly from v5.6 linux kernel - I will fix those issues. Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de