signal.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
/* subsystem signaling numbers: we split the numberspace for applications and
* libraries: from 0 to UINT_MAX/2 for applications, from UINT_MAX/2 to
* UINT_MAX for libraries. */
#define OSMO_SIGNAL_SS_APPS 0
#define OSMO_SIGNAL_SS_RESERVED 2147483648u
enum {
SS_L_GLOBAL = OSMO_SIGNAL_SS_RESERVED,
SS_L_INPUT,
SS_L_NS,
SS_L_VTY,
};
/* application-defined signal types. */
#define OSMO_SIGNAL_T_APPS 0
#define OSMO_SIGNAL_T_RESERVED 2147483648u
enum {
S_L_GLOBAL_SHUTDOWN = OSMO_SIGNAL_T_RESERVED,
};
typedef int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data);
/* Management */
int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
/* Dispatch */
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data);
osmo_signal_unregister_handler
void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Unregister signal handler.
Definition: signal.c:77
osmo_fd::data
void * data
Definition: select.h:33
osmo_signal_cbfn
int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
Definition: signal.h:34
osmo_signal_register_handler
int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Register a new signal handler.
Definition: signal.c:50
osmo_signal_dispatch
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
dispatch (deliver) a new signal to all registered handlers
Definition: signal.c:97