Annotation of coherent/a/usr/bob/uusrc/junk/segtrap.c, revision 1.1

1.1     ! root        1: #include <signal.h>
        !             2: #include <setjmp.h>
        !             3: jmp_buf helpme;
        !             4: int    stop;
        !             5: int    catchintr();
        !             6: catchintr()
        !             7: {
        !             8:        char    *cot = "Caught the silly interrupt\n";
        !             9:        signal(SIGSEGV, SIG_IGN);
        !            10:        write(1, cot, strlen(cot));
        !            11:        printf("Caught interrupt\n");
        !            12:        stop++;
        !            13:        signal(SIGSEGV, catchintr);
        !            14:        longjmp(helpme, 3);
        !            15: }
        !            16: 
        !            17: main()
        !            18: {
        !            19:        char    *cp;
        !            20:        int     c;
        !            21: 
        !            22:        stop = 0;
        !            23:        signal(SIGSEGV, catchintr);
        !            24:        if(setjmp(helpme) == 0) {
        !            25:                cp = (char *) 0x1A00;
        !            26:                c = *cp;
        !            27:        }
        !            28: 
        !            29:        printf("stop is %d\n", stop);
        !            30:        exit (0);
        !            31: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.