[cs631apue] sish -- backgrounding processes

Jan Schaumann jschauma at stevens.edu
Wed Dec 11 12:57:06 EST 2019


Elliot Wasem <ewasem at stevens.edu> wrote:
 
> So I'm confused about how sish is supposed to behave
> with background processes. Are we simply putting it
> in the background and allowing it to run to
> completion, with no chance of returning it to
> foreground?

Correct.  Managing backgrounded jobs is not part of
the assignment.

(It's true that this limits the usefulness of the
feature somewhat; I may revisit this in future
iterations, but don't want to change the requirements
at this point.)

> How would you suggest handling SIGCHLD in this case?
> If we background a process and don't setup a SIGCHLD
> handler, then the exited child will be a zombie, but
> if we set a sigchld handler of SIG_IGN, will that
> interfere with wait(2) for other processes?

You should set up a signal handler to receive SIGCHLD
and then wait(2) for the process in question.  See the
member 'si_pid' in siginfo(2) for one way to do that.

-Jan


More information about the cs631apue mailing list