WebAssembly / WebAssembly/WASI

[v0.3] Specify errors for `set-size`

Open
#712 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-filesystem
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

POSIX says that ftruncate on a read-only file descriptor could result in EBADF or EINVAL: https://pubs.opengroup.org/onlinepubs/000095399/functions/ftruncate.html. We might as well just specify that it's always bad-descriptor; if the WASI implementation sees EINVAL, it can know if it's a file not open for writing, because the implementation has to keep some metadata on descriptors in any case.

Similarly, for a length that is too large, it can be EFBIG or EINVAL. Maybe specify just file-too-large ?

Contributor guide

Open the contributing guide

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 with the set-size specification and the linked POSIX ftruncate documentation. Resolve which errors should be specified for read-only descriptors and oversized lengths, then update the specification so the resulting behavior is explicit and consistent for WASI implementations.

Written by the indexing model from the issue text.

Assessment

Tech stack
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.