Annotation of researchv10no/cmd/lcc/ph/d47b.c, revision 1.1.1.1

1.1       root        1: /* The Plum Hall Validation Suite for C
                      2:  * Unpublished copyright (c) 1986-1991, Chiron Systems Inc and Plum Hall Inc.
                      3:  * VERSION: 4
                      4:  * DATE: 1993-01-01
                      5:  * The "ANSI" mode of this suite corresponds to official ANSI C, X3.159-1989.
                      6:  * As per your license agreement, your distribution is not to be moved or copied outside the Designated Site
                      7:  * without specific permission from Plum Hall Inc.
                      8:  */
                      9: 
                     10: 
                     11: #include "flags.h"
                     12: #ifndef SKIP47
                     13: #define LIB_TEST 1
                     14: /*
                     15:  * 4.7 - Signal handling (Continued)
                     16:  */
                     17: #include "defs.h"
                     18: 
                     19: #if ANSI
                     20: #include <signal.h>
                     21: extern volatile sig_atomic_t flag_sig;
                     22: extern void (*prev_fn)(int);
                     23: typedef void (*PIF)(int);
                     24: 
                     25: /* handler - record signal number in flag_sig */
                     26: static void handler(sig_no)
                     27:        int sig_no;
                     28:        {
                     29:        flag_sig = sig_no;
                     30:        }
                     31: 
                     32: /* d4_7b - establish handler for sig_no */
                     33: PIF d4_7b(sig_no)
                     34:        int sig_no;
                     35:        {
                     36:        flag_sig = 0;
                     37:        prev_fn = signal(sig_no, handler);
                     38:        return (prev_fn);
                     39:        }
                     40: 
                     41: #include <setjmp.h>
                     42: /* d4_7b_2 - a signal handler that longjmps out */
                     43: void d4_7b_2(sig_no)
                     44:        int sig_no;
                     45:        {
                     46:        extern jmp_buf d7jbuf;
                     47: 
                     48:        longjmp(d7jbuf, sig_no);        /* no-return is ok; see 3.6.6.4 */
                     49:        }
                     50: #endif /* ANSI */
                     51: 
                     52: #endif /* SKIP47 */

unix.superglobalmegacorp.com

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