behavior of parent and child for a signal handler
问题 A process has a 'fork' call after a signal handler has been registered [for SIGINT]. what happens when SIGINT is sent through command line ? whether parent gets exited or child or both ? parent and child both are running infinite while loops. 回答1: If you do fork (without further exec* ) after a signal handler has been registered, the same signal handler will be used in parent and child processes. That is, if you do something other than exit in your SIGINT handler, neither parent nor child