Repository navigation
Conversation
…tives Add low-level `no_std` filesystem, I/O, and allocator-backed path resolution primitives needed by the freestanding Linux ELF/SIGSYS tracker and shared Unix exec resolver: - `fspy_nostd`: `Error::ACCES`, `pread`, `faccessat`, `stat`/`fstat`, `getcwd`, `readlinkat`/`fcntl_getpath`, plus unit tests. - `fspy_nostd_alloc`: allocator-backed `getcwd`, `fd_path`, `resolve_path_at`, and pooled bump allocator helpers, plus unit tests. - `vt_ipc_str`: `IpcStr::as_bytes` for Unix and `target_os = "none"`. - `fspy_shared`: gate host dev-dependencies on `not(target_os = "none")`. Co-authored-by: Gemini 4 Neon <noreply@google.com>
fspy benchmarklinuxmacoswindows |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6730e4b. Configure here.
Co-authored-by: Gemini 4 Neon <noreply@google.com>
…r decoding
- Wrap `PageBump` like `PooledBump` with unconditional `#[inline(never)]` on
`allocate`/`deallocate`/`grow` and drop unused `allocate_zeroed`/
`grow_zeroed`/`shrink` overrides
- Avoid panicking on odd byte lengths in Windows `IpcStr::to_os_string`
- Export `fspy_nostd_alloc::fs::format_proc_self_fd` for reuse
- Use `linux_raw_sys::general::{PATH_MAX, X_OK}` instead of literals in
`fspy_nostd::fs::linux`
- Tighten `BorrowedFd::try_borrow_raw` to accept only `fd >= 0 || fd == CWD_RAW`
- Remove dead/unreachable code (`mac::getcwd_small`, `Error::NOSYS`,
`AtFlags::REMOVEDIR`, and unreachable `OVERFLOW` fd conversions in Linux fs)
Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Replacing Linux
LD_PRELOADandseccomp_unotifywith an in-process freestanding (target_os = "none") ELF/SIGSYSlauncher requiresno_stdUnix filesystem, I/O, and allocator-backed path-resolution primitives shared between the freestanding Linux launcher and the macOS preload library.Changes
fspy_nostd: addError::ACCES(plus.typos.toml),pread,faccessat,stat/fstat,getcwd,readlinkat/fcntl_getpath, andOwnedFd::from_raw_fd, with unit tests.fspy_nostd_alloc: add allocator-backedgetcwd,fd_path,resolve_path_at, andPooledBumphelpers, with unit tests.vt_ipc_str: exposeIpcStr::as_bytesfor Unix andtarget_os = "none".fspy_shared: gate host dev-dependencies onnot(target_os = "none")for bare-metal builds.Stack created with GitHub Stacks CLI • Give Feedback 💬
Note
Medium Risk
New syscall wrappers and path resolution run in preload/signal-sensitive contexts; bump allocator inlining changes affect stack usage in constrained environments.
Overview
Adds no_std Unix filesystem and I/O building blocks for freestanding Linux and macOS preload:
pread,faccessat, extendedErrorerrno values,Stat::is_regular_file, Linuxfcntldup/close-on-exec helpers, and tighterBorrowedFd::try_borrow_raw(non-negative fds plusAT_FDCWDonly).fspy_nostd_allocgains allocator-backedfd_path,resolve_path_at, and Linuxformat_proc_self_fdfor joining paths relative to a dirfd; macOSgetcwdnow requires at leastPATH_MAX.PageBump/PooledBumpare concrete wrapper types with#[inline(never)]Allocatormethods to avoid blowing signal/vfork stack depth.Smaller fixes: public
OwnedFd::from_raw_fd,IpcStr::as_byteson Unix/none, safer Windowsto_os_stringon odd-length payloads, andfspy_shareddev-dependencies gated offtarget_os = "none".Reviewed by Cursor Bugbot for commit 1d28e3d. Bugbot is set up for automated code reviews on this repo. Configure here.