diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-14 20:41:28 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-16 19:40:44 +0100 |
| commit | dd55b7294946cf1982815518422a007b19438d71 (patch) | |
| tree | 1f5977cb9f3a9a66a9943791821f4247b742f663 /src/Module.zig | |
| parent | 49c0bb1f33044658909cae4351d931af497ee4e5 (diff) | |
| download | zig-dd55b7294946cf1982815518422a007b19438d71.tar.gz zig-dd55b7294946cf1982815518422a007b19438d71.zip | |
std: introduce posix_spawn as an alt to fork-exec
Currently, the new API will only be available on macOS with
the intention of adding more POSIX systems to it incrementally
(such as Linux, etc.).
Changes:
* add `posix_spawn` wrappers in a separate container in
`os/posix_spawn.zig`
* rewrite `ChildProcess.spawnPosix` using `posix_spawn` targeting macOS
as `ChildProcess.spawnMacos`
* introduce a `posix_spawn` specific `std.c.waitpid` wrapper which
does return an error in case the child process failed to exec - this
is required for any process that was spawned using `posix_spawn`
mechanism as, by definition, the errors returned by `posix_spawn`
routine cover only the `fork`-equivalent; `pre-exec()` and `exec()`
steps are covered by a catch-all error `ECHILD` returned by `waitpid`
on unsuccessful execution, e.g., no such file error, etc.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions
