www.delorie.com/gnu/docs/glibc/libc_466.html   search  
Buy the book!

The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24. Signal Handling

A signal is a software interrupt delivered to a process. The operating system uses signals to report exceptional situations to an executing program. Some signals report errors such as references to invalid memory addresses; others report asynchronous events, such as disconnection of a phone line.

The GNU C library defines a variety of signal types, each for a particular kind of event. Some kinds of events make it inadvisable or impossible for the program to proceed as usual, and the corresponding signals normally abort the program. Other kinds of signals that report harmless events are ignored by default.

If you anticipate an event that causes signals, you can define a handler function and tell the operating system to run it when that particular type of signal arrives.

Finally, one process can send a signal to another process; this allows a parent process to abort a child, or two related processes to communicate and synchronize.

24.1 Basic Concepts of Signals  Introduction to the signal facilities.
24.2 Standard Signals  Particular kinds of signals with standard names and meanings.
24.3 Specifying Signal Actions  Specifying what happens when a particular signal is delivered.
24.4 Defining Signal Handlers  How to write a signal handler function.
24.5 Primitives Interrupted by Signals  Signal handlers affect use of open,
 readwrite and other functions.
24.6 Generating Signals  How to send a signal to a process.
24.7 Blocking Signals  Making the system hold signals temporarily.
24.8 Waiting for a Signal  Suspending your program until a signal arrives.
24.9 Using a Separate Signal Stack  
24.10 BSD Signal Handling  Additional functions for backward compatibility with BSD.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003