1
0

sigdemo2.c 260 B

12345678910111213141516171819
  1. /* sigdemo2.c - shows how to ignore a signal
  2. * - press Ctrl-\ to kill this one
  3. */
  4. #include <stdio.h>
  5. #include <signal.h>
  6. main()
  7. {
  8. signal( SIGINT, SIG_IGN );
  9. printf("you can't stop me!\n");
  10. while( 1 )
  11. {
  12. sleep(1);
  13. printf("haha\n");
  14. }
  15. }