WebAssembly / WebAssembly/WASI
Error code for file offsets outside the range of `s64`
Nobody has claimed this yet.
- 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
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
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