y2038: Provide conversion helpers for struct __ntptimeval64
authorLukasz Majewski <lukma@denx.de>
Wed, 22 Apr 2020 22:20:51 +0000 (00:20 +0200)
committerLukasz Majewski <lukma@denx.de>
Tue, 19 May 2020 23:03:27 +0000 (01:03 +0200)
commit10ae49d2ce4576d8bb8f01d1fc1cbdf550ad4cbd
tree6b0fe2ed5198fe40f00e62bad2f3acd8e95d5e3f
parentdf4289508a3a0e345a87544ee4eea8cbb4c9d197
y2038: Provide conversion helpers for struct __ntptimeval64

Those functions allow easy conversion between Y2038 safe, glibc internal
struct __ntptimeval64 and struct ntptimeval.

The reserved fields (i.e. __glibc_reserved{1234}) during conversion are
zeroed as well, to provide behavior similar to one in ntp_gettimex function
(where those are cleared before the struct ntptimeval is returned).

Those functions are put in Linux specific sys/timex.h file, as putting
them into glibc's local include/time.h would cause build break on HURD as
it doesn't support struct timex related syscalls.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/include/sys/timex.h