Add process groups to unix backends#802
Merged
talex5 merged 1 commit intoocaml-multicore:mainfrom Aug 21, 2025
Merged
Conversation
talex5
reviewed
Aug 17, 2025
lib_eio/unix/fork_action.mli
Outdated
| val setpgid : pid:int -> pgid:int -> t | ||
| (** [setpgid ~pid ~pgid] sets the process group ID to [pgid] for the process [pid]. | ||
|
|
||
| If [pid] is [0] then the process ID of the calling process shall be used. *) |
Collaborator
There was a problem hiding this comment.
Would pid ever not be zero? If you want to set the group of an existing process then you can do that at any time; no need for a fork action.
I guess the other interesting thing to mention is that setting both to 0 puts the child in a new process group.
Collaborator
Author
There was a problem hiding this comment.
Good point, I have made the API only take the pgid and added comments explaining the effect of setpgid 0 in 1eb1197
talex5
approved these changes
Aug 20, 2025
Co-authored-by: Thomas Leonard <talex5@gmail.com>
Collaborator
|
I've rebased it to fix the CI problems. OK to merge once that passes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is, I hope, most of the plumbing for #595. It remains to decide on how best to expose this in
Eio.Processif at all.Also if anyone has a good, reproducible test for this, that would be good too!