WebAssembly / WebAssembly/wasi-libc
Implementing errno with WASI modularization
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1k
- Forks
- 251
- Avg merge
- 7h 15m
- Merged PRs (30d)
- 3
Description
With WASI modularization, each proposal will be moving to having its own error code, rather than a single unified errno across all WASI APIs:
- https://github.com/WebAssembly/wasi-filesystem/issues/29
- https://github.com/WebAssembly/wasi-clocks/issues/5
- https://github.com/WebAssembly/wasi-random/issues/8
- https://github.com/WebAssembly/wasi-poll/issues/2
- https://github.com/WebAssembly/wasi-classic-command/issues/6
- https://github.com/WebAssembly/wasi-handle-index/issues/2
WASI libc will need to repack these into a single integer space in order to implement a C-compatible errno.
Some WASI proposals are not listed here, such as wasi-nn and wasi-crypto, as they aren't expected to use the C errno variable to report their errors at the C source level. WASI libc's errno doesn't need to be aware of them.
My rough idea for how to combine these errors is to assign ranges to proposals that need them, so that the C errno value is computed by taking the raw WASI error code and adding the base value of the appropriate range.
Contributor guide
No contributing guide indexed for this repository
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 linked WASI proposal issues to understand each proposal's error-code space and which APIs need C-compatible errno handling. Then inspect the wasi-libc errno entry points and define how proposal-specific ranges would combine into one integer space; done means the mapping is implemented and consistent for all listed proposals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, wasm
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100