Closed kryne001 closed 10 years ago
Try taking another look at Lab 6: Signal Handling.
that's exactly what I did but idk I don't really see how it's not working. I thought if I catch the signal, I go into a function that kills the process but I doubt that's what should be happening.
You seem to be on the right track. It then comes down to what does the function that gets called doing by catching the interrupt doing.
I just don't get how I'm supposed to restart rshell, seeing how my rshell runs in an infinite loop. I tried putting continue
in my function, but obviously that won't work because continue
is in a function separate of the loop
huh? Why would you need to restart rshell?
isn't cntl+c supposed to reset the command line in rshell? instead of stopping the program altogether?
No,
per the specs.
The shell should not exit when the user types ^C
. Instead, the current foreground job should interrupt.
What this means is when ^C
is pressed you need to have your rshell send the appropriate signal to the current foreground process.
How would I interrupt the current foreground project? I'm trying to google a way to do it, can't find anything so far.
One easy way to do it is run kill
on the child process.
I don't get how the signal handling is supposed to work. I have a function to catch the
^C
signal but it just kills the program.