WebAssembly / WebAssembly/WASI

Error code for file offsets outside the range of `s64`

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

Nobody has claimed this yet.

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

Description

The filesize type is defined as unsigned u64. In POSIX, off_t is a signed type.

Most practical implementations won't support file sizes >= 263, so: what error code should implementations return if users attempt to create files that large? The natural behavior for POSIX-based implementations is EINVAL, corresponding to inval in wasi-filesystem. That makes sense in POSIX because it corresponds to a request to create a "negative" file size, which is not valid to request. However, size WASI has an unsigned type, perhaps it would be more natural to use insufficient-space?

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

Review the WASI filesystem behavior for creating files with sizes outside the signed off_t range, comparing the POSIX EINVAL mapping with insufficient-space. Done means the specification decides and documents which error code implementations should return.

Written by the indexing model from the issue text.

Assessment

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.