Chapter Contents

Previous

Next
SIGABND

SIGABND



Program Abnormal Termination


Default handling
Ignoring the signal
Information returned by siginfo
Notes on defining a handler
The SIGABND signal is raised when the operating system terminates the C program with a system ABEND code. This ABEND either indicates a misuse of an operating system feature or an error by the system processing a valid request.


Default handling

By default, the signal causes abnormal termination of the program with the ABEND code requested by the operating system. If SIGABND results from a call to siggen , the ABEND code is taken from the ABRT_t structure passed to siggen .


Ignoring the signal

The SIGABND signal cannot be ignored. Similarly, a handler for SIGABND cannot return to the point of interrupt; an attempt to do so causes ABEND to be reissued.


Information returned by siginfo

If you call siginfo after a SIGABND signal occurs, siginfo returns a pointer to a structure of type ABND_t . This structure is defined as:

typedef struct {
   unsigned ABEND_code;    /* ABEND code             */
   char *ABEND_str;        /* formatted ABEND code,  */
                           /* e.g., "B14", "U0240",  */
   void *ABEND_info;      /* OS SDWA, or CMS ABWSECT */
} ABND_t;

The ABEND_code contains the unmodified system ABEND code. For example, after a system 106 ABEND, the ABEND_code value is 0x106. The ABEND_str is a null-terminated string giving a printable form of the ABEND code.

The ABEND_info pointer addresses an ABEND status block provided by the operating system, which gives the ABEND PSW, registers, and other such information. Under OS/390, ABEND_str addresses an SDWA. Under CMS, it addresses an ABWSECT. For an ABEND issued by the SAS/C library, ABEND_info may be NULL .


Notes on defining a handler

A System ABEND in a C program is most likely to result from unexpected conditions in the C library. For example, the fopen function may ABEND if you attempt to open a file you are not authorized to access. If you provide a SIGTERM handler and use the longjmp function to continue program execution after such an ABEND, the library is not always able to clean up after the failure. This may prevent memory or other resources used by the library from being freed. For instance, after recovery from an ABEND in fopen , it may not be possible to open FOPEN_MAX files.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.