Skip to content

doc: Clarify path search in child_process spawn#41418

Merged
aduh95 merged 4 commits intonodejs:masterfrom
zobo:patch-1
Mar 14, 2022
Merged

doc: Clarify path search in child_process spawn#41418
aduh95 merged 4 commits intonodejs:masterfrom
zobo:patch-1

Conversation

@zobo
Copy link
Contributor

@zobo zobo commented Jan 6, 2022

child_process: clarify path search in spawn(), explain difference between unix/win when PATH is not present in env option

The documentation about command lookup could be more clear and note differences between Windows and Linux/OSX.
Current text gives the impression that if one passes options.env without PATH that the path search will fall back on process.env.PATH.
However in reality, passing environment without PATH to execvp causes it to look for the binary only in /usr/bin:/bin.
Also Windows behaves different and more in line with the current documentation text.

References:
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/execvp.3.html
https://linux.die.net/man/3/execvp

execvp(options->file, options->args);

path = find_path(env);

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants