grpc_signal_handler_set_np
- Set the signal handler.
grpc_error_t grpc_signal_handler_set_np(int sig_num, void (*sig_handler)(int))
int sig_num
void (*sig_handler)(int))
The grpc_signal_handler_set_np() function modifies signal dispositions for Ninf-G Client.
Procedures for signal handling differs according to environments and a signal to be processed.
Ninf-G uses signal handling API provided by GT4, but the API does not support SIGKILL, SIGSEGV, SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGIOT, SIGPIPE, SIGEMT, SIGSYS, SIGTRAP, SIGSTOP, SIGCONT and SIGWAITING.
If sig_num is supported by GT's signal handling API, sig_handler is called by a signal handling thread.
if sig_num is not supported by GT's signal handling API, sig_handler is called as a signal handler registered by sigaction().
Ninf-G has signal handling thread which supports the same signals as GT4 signal handling API.
If sig_num is supported by a Ninf-G signal handling thread, sig_handler is called by the signal handling thread. Otherwise, sig_handler is called as a signal handler registered by sigaction().
Note: For pthread flavor on MacOS X, Ninf-G Client processes SIGSTP as well.
sig_handler is called as a signal handler registered by sigaction().
It is unsafe to call some system calls from the signal handler registered by sigaction(). A list of safe system calls is available on the following web page and IEEE Std 1003.1(POSIX).
http://www.opengroup.org/onlinepubs/007908799/xsh/sigaction.html
This function is a new function in Ninf-G version 4.0.0.
This function is MT-safe.
If successful, GRPC_NO_ERROR is returned. In the case of an error, Error code is returned.
GRPC_NOT_INITIALIZED
GRPC_OTHER_ERROR_CODE