Conversation
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.
Revised kernel handling of
waitpidfor stopped processes; now returns the stopped status just once, per spec. Note that the WUNTRACED flag has to be passed in order to get status of any stopped processes. This simplifies the kernel implementation a bit, since the kernel will never wait for a process to restart when WUNTRACED is passed, regardless of the WNOHANG flag.The above fix allowed
ashto be made to work with its builtinjobscommand, which is now useful for displaying all background processes (both asynchronous commands started with '&' as well as any stopped commands). Note that actual "jobs" support is not implemented, sofgis not present. Nonetheless, thejobsenhancement allows a quicker way of finding background jobs without all the details ofps.The
killcommand and thesashkill builtin now support many more signal names (rather than signal numbers) to be specified in the command line. This now allows usingkill -CONT pidto continue a stopped process, orkill -STOP pidto stop one, for instance. The kill man page is also updated for full details.Here's an example of running a program

a.outwhich displays X's until stopped by ^Z or interrupted by ^C, and usingjobsfor displaying processes running under the shell:Note that stopping jobs that are waiting for input on the same terminal as the shell doesn't work well, and likely won't ever, due to the complications of implementing full job control in both the shell and kernel.