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

void taunt_user(int);

int main(void)
{
     int pid;
     struct sigaction newact;
     
     newact.sa_handler = taunt_user;
     sigfillset(&newact.sa_mask);
     sigdelset(&newact.sa_mask, SIGINT);
     sigdelset(&newact.sa_mask, SIGQUIT);
     sigprocmask(SIG_BLOCK, &newact.sa_mask, NULL);

     if (sigaction(SIGINT, &newact, NULL) < 0) {
          fprintf(stderr, "Error in sinal actions!\n");
          exit(1);
     }
     printf("PID: %d\n", getpid());
     while (1)
          pause();

     sleep(1);
     exit(0);
}

void taunt_user(int signum)
{
     printf("Received Signal No. %d\n", signum);
     printf("^C does not do anything to me ... bet you cannot kill me!\n");
}

     
