Fix hwclock to work with current glibc and musl, which have different bugs.

Glibc 2.31 broke the settimeofday() wrapper to return EINVAL if you set
the time and kernel timezone in the same call. (I have no idea why.)

Musl broke the settimeofday() wrapper to never call the settimeofday
syscall at all, which is the only way to set kernel timezone, and
then for good measure removed the __NR_settimeofday symbol from their
headers because people were still using it. (So use kernel header instead.)

(The kernel timezone is used on machines that dual boot with windows,
where the hardware clock is generally set to local time to humor windows.
Various filesystem code uses it to adjust the time read from and saved
to filesystems shared with windows.)
1 file changed