Skip to content

feat(registry): filesystem native-parity — stat mode bits, chmod, access#264

Open
NathanFlurry wants to merge 1 commit into
mainfrom
fs-native-parity
Open

feat(registry): filesystem native-parity — stat mode bits, chmod, access#264
NathanFlurry wants to merge 1 commit into
mainfrom
fs-native-parity

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member
  • wasi-libc patch exposes host permission bits via new host_fs.fd_mode/path_mode imports so stat/fstat/lstat return real Unix mode bits (0644/0755) instead of zero — this is what made vim open every file readonly
  • chmod/fchmod implemented via the host_fs bridge (previously ENOSYS)
  • access() reflects the mode's rwx bits (X_OK no longer always succeeds)
  • truncate/ftruncate update the size stat reports; fd metadata stays coherent with path metadata
  • fixes an intermittent EFAULT ("Bad address") on file create/write under wasm heap growth (the touch/:w failures)
  • adds fs_probe.c, a comprehensive filesystem edge-case probe diffed 1:1 against native Linux (paired with a vitest guard in agentos)
  • fixes are at the shared kernel-VFS / patched-wasi-libc / runner layer — native-Linux parity for all C tools, no per-program or vim/coreutils source patching

Verified in real just shell: vim opens writable, :w writes, touch succeeds; the native-parity test passes.

Teach the VM's filesystem layer POSIX permission semantics so native C tools
(vim, coreutils) behave like Linux:
- wasi-libc patch exposes host permission bits through new host_fs.fd_mode /
  path_mode imports so stat/fstat/lstat return real mode bits (0644/0755)
- chmod/fchmod implemented via the host_fs bridge (previously ENOSYS)
- access() reflects the mode's rwx bits (X_OK no longer always succeeds)
- truncate/ftruncate update the size stat reports; fd metadata stays coherent
- fixes an intermittent EFAULT on create/write under wasm heap growth
This fixes vim opening every file readonly and 'touch: Bad address', with a
comprehensive fs_probe.c that is diffed 1:1 against native Linux.
@railway-app

railway-app Bot commented Jul 4, 2026

Copy link
Copy Markdown

🚅 Environment secure-exec-pr-264 in rivet-frontend has no services deployed.


🚅 Deployed to the secure-exec-pr-264 environment in secure-exec

Service Status Web Updated (UTC)
secure-exec 😴 Sleeping (View Logs) Web Jul 4, 2026 at 2:23 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant