check whether all exec* calls can be posix_spawn #166

Open
opened 2024-03-21 18:38:02 +00:00 by pennae · 2 comments
Owner

posix_spawn is already used on macos, and it very much exists on linux. check whether we can replace all exec call with posix_spawn for consistency and to reduce the number of fork/exec dance we'll have to optimizie ourselves in the future.

`posix_spawn` is already used on macos, and it very much exists on linux. check whether we can replace all exec call with posix_spawn for consistency and to reduce the number of fork/exec dance we'll have to optimizie ourselves in the future.
lix-project referenced this issue from a commit 2025-01-29 18:11:13 +00:00
Author
Owner

good and bad news for this: error reporting by posix_spawn is incredibly bad (all post-fork errors are collapsed into child exit code 127, making them completely undebuggable), but posix_spawn is also simple enough that we can just reimplement it with useful error reporting.

good and bad news for this: error reporting by `posix_spawn` is incredibly bad (all post-fork errors are collapsed into child exit code 127, making them completely undebuggable), but `posix_spawn` is also simple enough that we can just reimplement it with useful error reporting.
Author
Owner

with cl/5073 merged this is almost possible now. non-linux platforms can use posix_spawn instead of exec, startProcess can go away, and even linux could use posix_spawn if we add a new libexec wrapper that does the restoreContext bookkeeping.

with cl/5073 merged this is almost possible now. non-linux platforms can use posix_spawn instead of exec, startProcess can go away, and even linux could use posix_spawn if we add a new libexec wrapper that does the `restoreContext` bookkeeping.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#166
No description provided.