-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc] Unify gettime implementations #65383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] Unify gettime implementations #65383
Conversation
fc68eeb
to
ab3c205
Compare
Similar to D159208, this patch unifies the calls to a syscall, in this patch it is the syscall SYS_clock_gettime/SYS_clock_gettime64. This patch also fixes calls to SYS_clock_gettime64 by creating a timespec64 object, passing it to the syscall and rewriting the timespec given by the caller with timespec64 object's contents. This fixes cases where timespec has a 4 bytes long time_t member, but SYS_clock_gettime is not available (e.g., rv32).
ab3c205
to
af569cd
Compare
added @gchatelet here as I'll try to also change the bazel files before merging this PR. |
|
cool, I tested with the command Michael sent and got no errors. I'll use it before merging my PRs. |
Similar to D159208, this patch unifies the calls to a syscall, in this patch it is the syscall SYS_clock_gettime/SYS_clock_gettime64.
This patch also fixes calls to SYS_clock_gettime64 by creating a timespec64 object, passing it to the syscall and rewriting the timespec given by the caller with timespec64 object's contents. This fixes cases where timespec has a 4 bytes long time_t member, but SYS_clock_gettime is not available (e.g., rv32).