Lab 4: Comments

Lab 4 has been graded by Ms. Saranya Sekar. You will receive an individual email with your mark details (sent to your SoC UNIX @comp.nus.edu.sg email address). If you have doubts about your code, comments given, or marks, please seek clarification with Ms. Saranya (a0076996@nus.edu.sg) and me. Here are the common mistakes that students made in Lab 4.

1. Did not kill child processes when exiting bush. This can be done with killpg(0, SIGHUP)
2. Did not catch SIGHUP signal at bush. So when bush calls killpg(0, SIGHUP), it hangs itself up!
3. Do something extra after execvp() or exit(). Nothing after the execvp() or exit() calls will run. For execvp(), the core image would have been replaced, so the subsequent code wouldn’t matter unless execvp() causes an error. For exit(), the process would have ended, so the subsequent code wouldn’t matter.
4. Mixing up signal() and kill(). signal() is not used to send a signal, but rather to install a customized signal handler. kill() is used to send a signal.