WebAssembly / WebAssembly/wasi-libc

Implementing errno with WASI modularization

Open
#239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

after next snapshot
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:

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.