libpsl-native: add KillProcess and WaitPid functions#63
Merged
adityapatwardhan merged 1 commit intoPowerShell:masterfrom May 17, 2021
Merged
libpsl-native: add KillProcess and WaitPid functions#63adityapatwardhan merged 1 commit intoPowerShell:masterfrom
adityapatwardhan merged 1 commit intoPowerShell:masterfrom
Conversation
These functions are used by powershell-unix to clean up SSH processes after they exit.
14 tasks
Member
|
@andschwa Can you help review this? |
| //! | ||
| bool KillProcess(pid_t pid) | ||
| { | ||
| return kill(pid, SIGKILL) == 0; |
Member
There was a problem hiding this comment.
Seems reasonable:
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
| //! | ||
| pid_t WaitPid(pid_t pid, bool nohang) | ||
| { | ||
| return waitpid(pid, NULL, nohang ? WNOHANG : 0); |
Member
There was a problem hiding this comment.
This seems fine to me, checked against the man pages on BSD and Linux.
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.
These functions are used by powershell-unix to clean up SSH processes
after they exit.
First part of fixes for PowerShell/PowerShell#13356.