signal:register SIGINT with signal()

SIGINT sent when CTRL-C is pressed.
signal:adding while(1) loop for waiting

First CTRL-C won't stop the process, which is expected.

However, the second CTRL-C stops the process, which gives
me impression that the registered handler only handles the
first instance of the signal, not any following ones.

I will know about this later, just document what I have seen.
signal:sigaction struct

The most important data structure of signal handling.

List it here for easier and quicker reference.