signal_handling.c demonstrates 2 (of many) methods of handling signals in Linux: signalfd and signal(). We want to demonstrate that these 2 work differently with GDB.
Compile the program with -g flag then run under GDB. To run with signalfd:
(gdb) r signalfd
Try pressing Ctrl+C. This will stop GDB and also terminate the program as it receives a SIGINT.