Preliminaries
Set up a bare repository on stu.cs.jmu.edu based on the instructions
in the CS 361 Submission Procedures,
using the name lab3-proc.git
.
Implementation Requirements: Processes and Signals
Your first task is to complete the implementation of
run_child()
in child.c
. This function should
create a child that runs and exits. The parent should get the child's
exit status and print the message. Note that the fprintf()
line is written to STDERR
and does not affect the test cases;
it is just for your reference when running the code.
Next, you will complete the functionality in signals.c
,
which focuses on signal handling. The first step is to complete
signal_lookup()
, which will return the number for a given
signal name. For example, signal_lookup("INT")
would return 2.
You will need to look up the other values in /usr/include/asm/signal.h
.
Once you have completed that function, complete the rest of the code
in this file. catch_loop()
will create a child process that overrides a signal handler and does
something bad. Specifically, the child enters an infinite loop; the
parent will wait for 60 seconds, then terminate the child with the
SIGINT
signal. You must use a signal handler to print the message
as explained in the comments.