about summary refs log tree commit diff
path: root/src/linux/clock_adjtime.c
Commit message (Collapse)AuthorAgeFilesLines
* clock_adjtime: add time64 support, decouple 32-bit time_t, fix x32Rich Felker2019-08-021-0/+110
| | | | | | | | | | | | | | | | | | | | 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.
* refactor adjtimex in terms of clock_adjtimeRich Felker2019-07-201-0/+2
| | | | | | this sets the stage for having the conversion logic for 64-bit time_t all in one file, and as a bonus makes clock_adjtime for CLOCK_REALTIME work even on kernels too old to have the clock_adjtime syscall.
* include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy2013-12-121-2/+0
|
* add clock_adjtime, remap_file_pages, and syncfs syscall wrappersRich Felker2012-09-161-0/+9
patch by Justin Cormack, with slight modification