
/* Copyright (c) 1987 Edinburgh Portable Compilers Ltd. All Rights Reserved. */

/*
                                                                         signal6
  06/09/89  - Generic version for fortran
            - has conditional complation for core dump call using 
            - compilation constants with -D
*/
#include <signal.h>
#include "ftnht.h"
 
#if target==drs || target==pn
    extern abort(void);
#endif

extern void f_onsignal(int info); 
 
void f_setsigs(void)
{
         /* Set traps to take interrupts to IMP diagnostics */
 
    if (signal(SIGFPE,  SIG_IGN) != SIG_IGN) signal(SIGFPE,  f_onsignal);
    if (signal(SIGILL,  SIG_IGN) != SIG_IGN) signal(SIGILL,  f_onsignal);
#ifndef __POSIX__
    if (signal(SIGEMT,  SIG_IGN) != SIG_IGN) signal(SIGEMT,  f_onsignal);
#endif
    if (signal(SIGSEGV, SIG_IGN) != SIG_IGN) signal(SIGSEGV, f_onsignal);
    if (signal(SIGIOT,  SIG_IGN) != SIG_IGN) signal(SIGIOT,  f_onsignal);
    if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) signal(SIGQUIT, f_onsignal);
    if (signal(SIGBUS,  SIG_IGN) != SIG_IGN) signal(SIGBUS,  f_onsignal);
}


#if target==unisys || target==pn
void coredump(void)
{
    signal(SIGIOT, SIG_DFL); /* disable IOT trap to allow abort*/
    abort();
}

int s_sizeof(void *s)
{
}
#endif

