Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

signals.h File Reference

Go to the source code of this file.

Functions

void set_signal (int sig)
 Set the signal to manipulate.

int block_all_signal ()
 Block the signal my_sig only. All other signals are allowed.

int retore_signal ()
 Unblock the signal my_sig.

int get_pending_signals ()
 Look if there are any my_sig pending signals. If it is the case, the pensding signales are activated.

int set_signal_handler (void(*handler)(int))
 Set a signal handler on the signal my_sig.


Detailed Description

Header file for signals.c

Definition in file signals.h.


Function Documentation

int block_all_signal  
 

Block the signal my_sig only. All other signals are allowed.

Returns:
If the operation was successful, the function returns 0. Otherwise tha function returns 1. Please note that this function should never fail. If it fails, then you are in deep trouble ... check your system.
Warning:
You must call set_signal() before you can use this function !.

Definition at line 34 of file signals.c.

References my_sig, and new_set.

int get_pending_signals  
 

Look if there are any my_sig pending signals. If it is the case, the pensding signales are activated.

Returns:
If the operation was successful, the function returns 0. Otherwise tha function returns 1. Please note that this function should never fail. If it fails, then you are in deep trouble ... check your system.
Warning:
If you look at the man page for the function 'sigsuspend()', you see that 'sigsuspend()' can set 'errno' to EINTR. But you must ignore it, otherwise you create an infinite loop. Indeed, every time 'sigsuspend()' raises a pending signal, 'sigsuspend()' is interrupted ... And therefore, EINTR is set!. You must call set_signal() before you can use this function !.

Definition at line 101 of file signals.c.

References my_sig.

int retore_signal  
 

Unblock the signal my_sig.

Returns:
If the operation was successful, the function returns 0. Otherwise tha function returns 1. Please note that this function should never fail. If it fails, then you are in deep trouble ... check your system.
Warning:
You must call set_signal() before you can use this function !.

Definition at line 66 of file signals.c.

References my_sig, and new_set.

void set_signal int    sig
 

Set the signal to manipulate.

Parameters:
sig Signal to manipulate.

Definition at line 21 of file signals.c.

References my_sig.

int set_signal_handler void(*    handler)(int)
 

Set a signal handler on the signal my_sig.

Parameters:
handler Pointer to the signal's handler. The function's prototype should look something like: void function_name(int).
Returns:
If the operation was successful, the function returns 0. Otherwise tha function returns 1. Please note that this function should never fail. If it fails, then you are in deep trouble ... check your system.
Warning:
You must call set_signal() before you can use this function !.

Definition at line 130 of file signals.c.

References my_sig.


Generated on Thu Apr 3 16:23:47 2003 for Common_C_libraries by doxygen1.3-rc1