#include #include int keep_looping = 1; void handle_interrupt (int sig) { keep_looping = 0; } /* After starting this program, run ps aux | grep /tmp/x$ | grep -v grep | awk '{ print $2 }' to get the process ID of it. */ int main (int argc, char *argv[]) { signal (SIGTERM, handle_interrupt); while (keep_looping) ; printf ("hello, world\n"); return 0; }