strsignal

Name

strsignal -- return string describing signal

Synopsis

#define _GNU_SOURCE
#include <string.h>

char * strsignal(int sig);

extern const char * const sys_siglist[];

Description

The strsignal() function shall return a pointer to a string describing the signal number sig. The string can only be used until the next call to strsignal().

The array sys_siglist holds the signal description strings indexed by signal number. This array should not be accessed directly by applications.

Return Value

If sig is a valid signal number, strsignal() shall return a pointer to the appropriate description string. Otherwise, strsignal() shall return either a pointer to the string "unknown signal", or a null pointer.

Although the function is not declared as returning a pointer to a constant character string, applications shall not modify the returned string.