Chapter Contents

Previous

Next
SIGINT

SIGINT



Interactive Terminal Attention Signal


Default handling
Ignoring the signal
Information returned by siginfo
Notes on defining a handler
SIGINT is an asynchronous signal. The SIGINT signal is raised when the terminal user requests a program interruption. Under OS/390, the terminal PA1 or ATTN key raises the SIGINT signal; under CMS, the IC (Interrupt C) immediate command raises SIGINT . However, if you are executing the program using the debugger, you must use the debugger attn command to generate a SIGINT signal. (The PA1/ATTN key or the IC command is intercepted and handled by the debugger.) The debugger attn command is handled as if SIGINT were raised by the normal methods.


Default handling

The library does not perform any default actions for the SIGINT signal. If the program is executing under OS/390, the PA1/ATTN key is handled by the program that invoked the C program (for example, ISPF or the TSO terminal monitor program). If the program is executing under CMS, the IC command is treated as an unknown command.


Ignoring the signal

Ignoring SIGINT by coding SIG_IGN as the second argument in the call to signal does not have the same effect as default handling. If SIGINT is ignored, use of the PA1/ATTN key or the IC command is recognized but it has no effect on the program.


Information returned by siginfo

When siginfo is called in a handler for SIGINT , it returns NULL .


Notes on defining a handler

Because SIGINT is an asynchronous signal, the library discovers the signal only when you call a function, when a function returns, or when you issue a call to sigchk . SIGINT frequently occurs while the program is reading from the terminal. If this occurs and the handler for SIGINT returns to the point at which the signal occurred, the input request is reissued, unless the handler set the error flag for the file.


Chapter Contents

Previous

Next

Top of Page

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