net-snmp 5.7
Functions | Variables
POSIX signals support for agents.
Registry of MIB subtrees, modules, sessions, etc

Registering and unregistering signal handlers. More...

Functions

RETSIGTYPE agent_SIGCHLD_handler (int sig)
int register_signal (int sig, void(*func)(int))
 Registers a POSIX Signal handler.
int unregister_signal (int sig)
 Unregisters a POSIX Signal handler.

Variables

int external_signal_scheduled [NUM_EXTERNAL_SIGS]
void(* external_signal_handler [NUM_EXTERNAL_SIGS])(int)

Detailed Description

Registering and unregistering signal handlers.


Function Documentation

int register_signal ( int  sig,
void(*)(int)  func 
)

Registers a POSIX Signal handler.

Implements the signal registering process for POSIX and non-POSIX systems. Also, unifies the way signals work. Note that the signal handler should register itself again with signal() call before end of execution to prevent possible problems.

Parameters:
sigPOSIX Signal ID number, as defined in signal.h.
funcNew signal handler function.
Returns:
value is SIG_REGISTERED_OK for success and SIG_REGISTRATION_FAILED if the registration can't be handled.

Definition at line 2353 of file agent_registry.c.

int unregister_signal ( int  sig)

Unregisters a POSIX Signal handler.

Parameters:
sigPOSIX Signal ID number, as defined in signal.h.
Returns:
value is SIG_UNREGISTERED_OK for success, or error code.

Definition at line 2392 of file agent_registry.c.