15 Pipes and FIFOs
hwww.gnu.org/software/libc/manual/html_node/Pipes-and-FIFOs.html
24 Signal Handling
www.gnu.org/software/libc/manual/html_node/Signal-Handling.html
For Ctl-C you have to register a signal handler for the signal SIGINT.
signal(SIGINT, my_handler);
If the signal is triggered, the signal handler is processed, which then
sets a variable, or performs other tasks.
void my_handler(int sig){
flag = 1;
}
Alternatively, you can also wait for the signal with sigwait().