#include <signal.h>void (*signal(int signal, void (*func)(int))) (int);

The signal( ) function registers the function pointed to by func as a handler for the signal specified by signal. That is, the function pointed to by func will be called when signal is received by your program. It uses the header <signal.h>, or <csignal> in a C++ program.

The value of func can be the address of a signal handler function or one of the following macros, defined in <signal.h>:




Use default signal handling


Ignore the signal

If a function address is used, the specified handler will be executed when its signal is received. Check your compiler’s documentation for additional details.

On success, signal( ) returns the address of the previously defined function for the specified signal. On error, SIG_ERR (defined in <signal.h>) is returned.

A related function is raise( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: