Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    while(sleep(1)) {
    
    }
    
  2. or download this
    $ perl test.pl 
    My pid is: 3188
    ...
    $ kill -SIGUSR1 3188
    got signal.
    ---> script is terminated
    
  3. or download this
    #include <stdio.h>
    #include <stdlib.h>
    ...
    void usr1handler(int signal) {
        printf("Got a signal: %d\n", signal);
    }
    
  4. or download this
    $ ./test 
    My pid is: 3188
    ...
    $ kill -SIGUSR1 3318
    Got a signal called: 10
    ... it never exits