-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename std.ChildProcess.exec
to avoid ambiguity with posix exec which replaces current image with new process
#5853
Comments
However, coming from a Windows environment, this is not the behavior I expect. Should std.ChildProcess.exec be expected to follow POSIX definitions? Perhaps instead of making it noreturn, it can simply be renamed to |
Yeah it might be best if we avoid Give that the module is |
std.ChildProcess.exec
calls spawn
(fork/exec) instead of exec
std.ChildProcess.exec
to avoid ambiguity with posix exec which replaces current image with new process
any thoughts on |
Why not follow POSIX conventions? Even in Windows, some form of POSIX has been available for the last 29 years (since Windows NT 3.1). I didn't ask for exec to be renamed. |
Regarding the POSIX question, I see a number of possible outcomes:
To be clear, I'm absolutely fine with 1 and 2. I'm very much against 3, and obviously can't have an opinion on 4 until a proposal is made. |
If |
True, |
Do no touch non-Zig code. Closes ziglang#5853.
Do no touch non-Zig code. Adjust error names as well, if associated. Justification: exec is a unix concept, the portable version should be called differently. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes ziglang#5853.
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes #5853.
The
std.ChildProcess.exec
function doesn't follow the expected behaviour of replacing the executable with the new program beingexec
'ed. See the SO question "Differences between fork and exec" for details on howfork
andexec
should behave.Currently,
std.ChildProcess.exec
creates astd.ChildProcess
instance and then calls itsspawn
method - returning anExecResult
struct:zig/lib/std/child_process.zig
Lines 186 to 206 in f23987d
I expect that
std.ChildProcess.exec
should notfork
orspawn
, and it should have a!noreturn
result (perhapsExecError!noreturn
withExecError
being much the same as aSpawnError
).The text was updated successfully, but these errors were encountered: