#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>

void sig_handler(int signo)
{
    printf("Caught signal %d, coming out...\n", signo);
    exit(1);
}

int main(void)
{
    printf("My pid is %d.\n", getpid());
    signal(SIGINT, sig_handler);
    while(1)
    {
        sleep(1);
    }
    exit(0);
} 
