Skip to content
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

Add fork-exec for macos #56

Closed
wants to merge 4 commits into from
Closed

Add fork-exec for macos #56

wants to merge 4 commits into from

Conversation

aleck099
Copy link

@aleck099 aleck099 commented Dec 7, 2024

use extra pipe for retrieving errors in sub process

aleck099 added 4 commits December 7, 2024 23:22
On linux, syscall __NR_exit_group if present, otherwise __NR_exit instead
On other platform, call _exit provided by libc
The linkage error on Darwin is left unchanged
…or macos

macos marks vfork() as deprecated without providing any alternative
way to create processes.

posix_spawn() doesn't work since it returns ok even if the process fails
to run in situations like, file not found, permission denied and so on.

We must use another extra pipe to retrieve the status of sub process
after fork(). This is how we do in this commit

Also fix bug introduced in 2b50a25
  wrong implemention of posix_process::operator=(posix_process&&)
@aleck099 aleck099 closed this Dec 7, 2024
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