my_trap.c

Go to the documentation of this file.
00001 #include <signal.h>
00002 char cmd[100];
00003 
00004 main(int argc, char *argv[])
00005 {
00006    void sighandler();
00007    int i, offset = 0;
00008 
00009    signal(SIGQUIT, sighandler);
00010    for (i = 1; i < argc; i++) {
00011        strcpy(cmd + offset, argv[i]);
00012        offset += strlen(argv[i]);
00013        cmd[offset++] = ' ';
00014    }
00015    cmd[offset] = '\0';
00016    pause();
00017 }
00018 
00019 void sighandler()
00020 {
00021   system(cmd);
00022 }

Generated on Sun May 30 18:38:35 2004 for Routix OS by doxygen 1.3.6