On Sun, Feb 14, 2021 at 07:00:39PM +0100, Hauke Mehrtens wrote:
glibc 2.14 was released 1. June 2011 and musl libc also supports this function since version v0.9.7 28. October 2012. I would just assume that the libc has this function.
Considering that somebody wanted it to work with a GNU libc prior to 2011, why would we not assume that somebody will eventually want it to work with a musl libc prior to 2012?
musl also does some special handling, probably for the 64 bit time handling, in this function: https://git.musl-libc.org/cgit/musl/tree/src/linux/clock_adjtime.c#n37 I am not sure if this will also work fine with the compat function.
I've stared at commit https://git.musl-libc.org/cgit/musl/commit/src/linux/clock_adjtime.c?id=2b4f... which added the conversion logic between struct ktimex64/struct ktimex and struct timex, and sadly I don't understand what is the point of wrapping the clock_adjtime function around the SYS_clock_adjtime64 syscall, when the struct timex::time member will still not be Y2038 safe on 32-bit systems...
That being said, I didn't know that musl libc provides any wrappers around these syscalls.