


8.5.1 Signals and psh2.c
psh2.c를 실행해서 tr명령어를 실행시켰을 때
Ctrl + C를 입력하면 어떤 일이 일어날까?
=> Ctrl + C라는 SIGINT는 tr뿐만 아니라 psh2.c를 kill한다.
Process가 종료되는 과정
exit 과 _exit (참고용)
(a) Flush all the streams.
(b) Call functions that have been registered with atexit() and
on_exit().
(c) Perform any other functions associated with exit() for the
current system.
(d) Call the system call _exit().
_exit() 과정
1) 모든 파일 디스크립터, 디렉토리 디스크립터들을 닫는다.
2) Change the parent PID of all its children to the PID of init.
3) 부모가 wait를 함
4) 부모한테 SIGCHLD를 보냄 => 부모가 waitpid를 받고 깨어남
execve()
환경 변수
