Lab 4: Solution and Problem

I am making an exception and made a sample solution to Lab 4 available.

We have discovered errors with the grades and marks given out to Lab 4. This means that the email you received may contain incorrect marks and comments. IMPORTANT: if you receive a full marks, you should still check your solution against the sample posted — because your solution could still be wrong or incomplete.

I apologize for the errors, and I am regrading all of your Lab 4 submissions to make this right.

There is no specific question about shell and Lab 4 in the midterm, in case you are wondering. But you should still get familiarize with the system calls involved, including fork, wait, exec, exit, signal, and kill.

2 thoughts on “Lab 4: Solution and Problem

  1. Prof,

    how do we know if our solution is correct?

    1) If i used SIGKILL instead of SIGHUP when killing the child process, am i considered wrong?

    2) In your solution, you used switch to check for pid and have a default case. What if i check for whether it’s supposed to run in background first and then whether its a child/parent process instead?


    • 1) Yes, you can use SIGKILL, although SIGHUP is more appropriate, as suggested by the lab instruction.

      2) I can’t tell without looking at your code and without your real name I can look it up to answer you question.. Sorry.

Comments are closed.