Repository navigation
date: fix wasi clock resolution and system datetime support - #13687
Conversation
|
GNU testsuite comparison: |
f767364 to
2321086
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
2321086 to
b3d7f8f
Compare
088a4d0 to
d2b7ca2
Compare
3527d4f to
3c980e5
Compare
Head branch was pushed to by a user without write access
3c980e5 to
f82440a
Compare
|
Binary size comparison: |
715fc00 to
7cc713f
Compare
|
@sylvestre, this one is ready (now with proper testing in place). |
7cc713f to
5015903
Compare
8801020 to
32fa6ab
Compare
0f3483e to
8a63170
Compare
|
sorry but it needs to be rebased |
|
Thanks, the earlier comments are all handled. One thing is still missing: nothing runs the new |
8a63170 to
cd2d95d
Compare
|
As requested, added |
cd2d95d to
07672dc
Compare
date implements get_clock_resolution via libc::clock_getres (rustix's excludes WASI) and set_system_datetime for WASI, the latter reporting "not supported" since the sandbox has no wall-clock-set syscall.
07672dc to
d7401e1
Compare
| let res = get_clock_resolution(); | ||
|
|
||
| // Every supported platform reports a resolution of at least 1ns. | ||
| let nanos = res.as_second() as i128 * 1_000_000_000 + i128::from(res.subsec_nanosecond()); |
There was a problem hiding this comment.
res.as_nanosecond() already returns an i128, no need to compute it by hand
date implements get_clock_resolution via libc::clock_getres (rustix's excludes WASI) and set_system_datetime for WASI, the latter reporting "not supported" since the sandbox has no wall-clock-set syscall.