about summary refs log tree commit diff
path: root/src/time
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-07-30 23:51:45 -0400
committerRich Felker <dalias@aerifal.cx>2019-08-02 00:08:23 -0400
commit2b4fd6f75b4fa66d28cddcf165ad48e8fda486d1 (patch)
tree682eb0797308379efae78da1c705390bc59696fa /src/time
parent2e554617e5a6a41bf3f6c6306c753cd53abf728c (diff)
downloadmusl-2b4fd6f75b4fa66d28cddcf165ad48e8fda486d1.tar.gz
musl-2b4fd6f75b4fa66d28cddcf165ad48e8fda486d1.tar.xz
musl-2b4fd6f75b4fa66d28cddcf165ad48e8fda486d1.zip
clock_adjtime: add time64 support, decouple 32-bit time_t, fix x32
the 64-bit/time64 version of the syscall is not API-compatible with
the userspace timex structure definition; fields specified as long
have type long long. so when using the time64 syscall, we have to
convert the entire structure. this was always the case for x32 as
well, but went unnoticed, meaning that clock_adjtime just passed junk
to the kernel on x32. it should be fixed now.

for the fallback case, we avoid encoding any assumptions about the new
location of the time member or naming of the legacy slots by accessing
them through a union of the kernel type and the new userspace type.
the only assumption is that the non-time members live at the same
offsets as in the (non-time64, long-based) kernel timex struct. this
property saves us from having to convert the whole thing, and avoids a
lot of additional work in compat shims.

the new code is statically unreachable for now except on x32, where it
fixes major brokenness. it is permanently unreachable on 64-bit.
Diffstat (limited to 'src/time')
0 files changed, 0 insertions, 0 deletions