WebAssembly / WebAssembly/WASI

a `st_blksize` analog for `filestat`

Open
#770 0 comments 1 reaction 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

Some applications rely on struct stat to contain a st_blksize field to determine what size buffer to use. filestat doesn't currently provide this information.

It may also be useful to have a field providing the size of the file without any "holes" included, which would let libc implement a st_blocks field. POSIX's st_blocks is in 512-byte units (regardless of the st_blksize value), which is awkward, but if WASI itself simply provides the size in bytes, libc can divide by 512 to satisfy POSIX.

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 by reviewing the WASI filestat interface and the issue's comparison with POSIX struct stat, especially st_blksize and st_blocks. Determine whether WASI should expose buffer block size, hole-free file size, or both, and define byte units that allow libc to derive the POSIX fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.