ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        jacob/cs343-translation
        jenkins-sandbox
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        with_gc
      
      
        
          | 
            Last change
 on this file since ce28c7b was             4149d9d, checked in by Thierry Delisle <tdelisle@…>, 8 years ago           | 
        
        
          | 
             
replacing old repeat script with c program 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            658 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [4149d9d] | 1 | #include <stdio.h>
 | 
|---|
 | 2 | #include <stdlib.h>
 | 
|---|
 | 3 | #include <signal.h>
 | 
|---|
 | 4 | 
 | 
|---|
 | 5 | void sig_handler(int signo)
 | 
|---|
 | 6 | {
 | 
|---|
 | 7 |         fprintf(stderr, "received %d\n", signo);
 | 
|---|
 | 8 |         exit(0);
 | 
|---|
 | 9 | }
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 | void sig(int signo) {
 | 
|---|
 | 12 |         if (signal(signo, sig_handler) == SIG_ERR)
 | 
|---|
 | 13 |         {
 | 
|---|
 | 14 |                 fprintf(stderr,"Error\n");
 | 
|---|
 | 15 |                 exit(1);
 | 
|---|
 | 16 |         }
 | 
|---|
 | 17 | }
 | 
|---|
 | 18 | 
 | 
|---|
 | 19 | int main(void)
 | 
|---|
 | 20 | {
 | 
|---|
 | 21 |         printf("Starting...\n");
 | 
|---|
 | 22 |         sig(SIGHUP);
 | 
|---|
 | 23 |       sig(SIGINT);
 | 
|---|
 | 24 |       sig(SIGQUIT);
 | 
|---|
 | 25 |       sig(SIGILL);
 | 
|---|
 | 26 |       sig(SIGABRT);
 | 
|---|
 | 27 |       sig(SIGFPE);
 | 
|---|
 | 28 |       sig(SIGSEGV);
 | 
|---|
 | 29 |       sig(SIGPIPE);
 | 
|---|
 | 30 |       sig(SIGALRM);
 | 
|---|
 | 31 |       sig(SIGTERM);
 | 
|---|
 | 32 |       sig(SIGUSR1);
 | 
|---|
 | 33 |       sig(SIGUSR2);
 | 
|---|
 | 34 |       sig(SIGCHLD);
 | 
|---|
 | 35 |       sig(SIGCONT);
 | 
|---|
 | 36 |       sig(SIGTSTP);
 | 
|---|
 | 37 |       sig(SIGTTIN);
 | 
|---|
 | 38 |       sig(SIGTTOU);
 | 
|---|
 | 39 |         while(1);
 | 
|---|
 | 40 |         return 0;
 | 
|---|
 | 41 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.