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

void fun(int signo)
{
   printf("test for sigaction.\n");
}

main()
{
   struct sigaction action, oldaction;
   action.sa_handler=fun;
   sigemptyset(&action.sa_mask);
   action.sa_flags=SA_RESETHAND;
   sigaction(SIGINT,&action,&oldaction);
   printf("waiting for SIGINT...\n");
   while(1)
   {
	pause();
   }
}
