mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 12:14:42 +00:00
refactor adjtime function using adjtimex function instead of syscall
this removes the assumption that userspace struct timex matches the syscall type and sets the stage for 64-bit time_t on 32-bit archs.
This commit is contained in:
parent
107d68ad17
commit
e53a91da58
@ -15,7 +15,7 @@ int adjtime(const struct timeval *in, struct timeval *out)
|
||||
tx.offset = in->tv_sec*1000000 + in->tv_usec;
|
||||
tx.modes = ADJ_OFFSET_SINGLESHOT;
|
||||
}
|
||||
if (syscall(SYS_adjtimex, &tx) < 0) return -1;
|
||||
if (adjtimex(&tx) < 0) return -1;
|
||||
if (out) {
|
||||
out->tv_sec = tx.offset / 1000000;
|
||||
if ((out->tv_usec = tx.offset % 1000000) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user