Using signal() in SA_OLDSTYLE and Full-Size Core Files


Contents

About This Document
Procedure

About This Document

This document addresses using signal() in SA_OLDSTYLE and full-size core files. This document applies to AIX Version 3.2.

Procedure

Add the following to your code in some configuration .h file. This will allow you to use signal() in the SA_OLDSTYLE of handling, but also produce full size core files.

 
#include <stdio.h> 
#include <sys/types.h> 
#include <sys/signal.h> 
#define signal  SIGNAL 
void (*SIGNAL(int signo, void (*fcn)(int))) 
{ 
        struct  sigaction       act, oact; 
        act.sa_handler = fcn; 
        sigemptyset(&(act.sa_mask)); 
        act.sa_flags = SA_FULLDUMP | SA_OLDSTYLE; 
        if (sigaction(signo, &act, &oact)) 
                return(SIG_ERR); 
        else 
                return(oact.sa_handler); 
} 
 
/*********************************************************************/ 
main() 
{ 
        int     sigcatch(); 
        signal(SIGQUIT, sigcatch); 
        for (;;) sleep(1);              /* sleep forever */ 
                        /* send two SIGQUIT's to the process and 
                        ** the second one will produce the core file 
                        */ 
} 
int sigcatch() 
{ 
        printf("Caught the signal"); 
} 

Using signal() in SA_OLDSTYLE and Full-Size Core Files: sigfulldump.c.32.lng ITEM: FAX
Dated: 99/03/08~00:00 Category: lng
This HTML file was generated 99/06/24~12:42:01
Comments or suggestions?
Contact us