WebAssembly / WebAssembly/WASI
clocks: Cannot implement `clock_nanosleep(CLOCK_REALTIME, ...)` in C
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
Currently WASIp{2,3} WITs for wasi:clocks only support subscribing to the monotonic clock, not the wall clock. This means that it's required for C programs to sleep with CLOCK_MONOTONIC instead of CLOCK_REALTIME. This issue was papered over with the historical WASIp1-to-WASIp2 adapter and never surfaced, but the libc implementation is slightly different in that it rejects sleeping with CLOCK_REALTIME since that's not actually supported. I'm not aware of a reason to specifically not support this, so I wanted to file an issue to eventually add the same-style subscribe* functions to the wasi:clocks/wall-clock interface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the wasi:clocks WITs, especially the wasi:clocks/wall-clock interface, and compare them with the monotonic-clock subscribe* functions. Trace the libc handling of clock_nanosleep and determine the interface changes needed so CLOCK_REALTIME is supported; done means the wall-clock subscription path and corresponding C behavior are implemented and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, wasm
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100