strsignal - get string describing signal
#include <string.h> char *strsignal(int sig);
The strsignal() function maps the signal number in sig to a string describing the signal and returns a pointer to that string. It uses the same set of the messages as psignal(3C).
The returned string should not be overwritten or freed by the caller. The returned pointer might be invalidated or the string content might be overwritten by a subsequent call to either strsignal() or setlocale(). The returned pointer might also be invalidated if the calling thread is terminated.
The strsignal() function returns NULL if sig is not a valid signal number.
Messages returned from this function are in the native language specified by the LC_MESSAGES locale category. See setlocale(3C).
The strsignal() function returns a description of the signal, while the sig2str(3C) function returns the signal name (without the "SIG" prefix). For instance, strsignal(SIGHUP) in the "C" locale returns the string "Hangup", while sig2str(SIGHUP, buf) returns the string "HUP".
See attributes(7) for descriptions of the following attributes:
|
gettext(3C), psignal(3C), setlocale(3C), sig2str(3C), attributes(7)
The strsignal() function has been included in Solaris since the Solaris 2.0 release.