Skip to content

Add a way to way to wait for process groups.#846

Merged
sunfishcode merged 1 commit intomainfrom
sunfishcode/waitpgid
Sep 25, 2023
Merged

Add a way to way to wait for process groups.#846
sunfishcode merged 1 commit intomainfrom
sunfishcode/waitpgid

Conversation

@sunfishcode
Copy link
Copy Markdown
Member

When the Pid type changed to only accept positive pid values, the waitpid function became unable to wait for process groups, because that involves negative pids. Fully fixing this will require a semver bump, but for now, we can add a new waitpgid function to add support for waiting for a process group.

Also add a Pgid arm to WaitId, to support waiting for process groups from waitid as well.

When the `Pid` type changed to only accept positive pid values,
the `waitpid` function became unable to wait for process groups,
because that involves negative pids. Fully fixing this will
require a semver bump, but for now, we can add a new `waitpgid`
function to add support for waiting for a process group.

Also add a `Pgid` arm to `WaitId`, to support waiting for process
groups from `waitid` as well.
sunfishcode added a commit to sunfishcode/c-ward that referenced this pull request Sep 22, 2023
Negative pid values mean to wait for process groups, however this
isn't currently working in rustix. As a temporary workaround, have
`waitpid` call `wait` in this situation.

When bytecodealliance/rustix#846 is released, we can use `waitpgid`,
but until then, this workaround gets more things working.
sunfishcode added a commit to sunfishcode/c-ward that referenced this pull request Sep 22, 2023
Negative pid values mean to wait for process groups, however this
isn't currently working in rustix. As a temporary workaround, have
`waitpid` call `wait` in this situation.

When bytecodealliance/rustix#846 is released, we can use `waitpgid`,
but until then, this workaround gets more things working.
@sunfishcode sunfishcode merged commit 08886a9 into main Sep 25, 2023
@sunfishcode sunfishcode deleted the sunfishcode/waitpgid branch September 25, 2023 05:19
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