Skip to content

refactor(proc): share executable-file probe in which - #36

Merged
HaoZeke merged 1 commit into
mainfrom
refactor/proc-executable-file-check
Nov 19, 2026
Merged

HaoZeke merged 1 commit into
mainfrom
refactor/proc-executable-file-check

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

proc.which checks each PATH candidate with an inline sequence of the
sys.z conversion and faccessat(X_OK) followed by a regular-file
stat. The private helper isExecutableFile holds that probe, and
which calls it for each candidate, so a later resolver can share the
same check.

The behaviour of which stays the same. src/proc.zig holds no direct
which test, and the PATH lookup case of the resolveExecutable test
in the following commit runs through it.

`proc.which` checks each PATH candidate with an inline sequence of the
`sys.z` conversion and `faccessat(X_OK)` followed by a regular-file
stat. The private helper `isExecutableFile` holds that probe, and
`which` calls it for each candidate, so a later resolver can share the
same check.

The behaviour of `which` stays the same. `src/proc.zig` holds no direct
`which` test, and the PATH lookup case of the `resolveExecutable` test
in the following commit runs through it.
@HaoZeke
HaoZeke merged commit d64f281 into main Nov 19, 2026
8 checks passed
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