Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.

SIGNALNAME(3) Library Functions Manual SIGNALNAME(3)NAMEsignalname,signalnumber,signalnext- convert between signal numbers and namesLIBRARYStandard C Library (libc, -lc)SYNOPSIS#include<signal.h>const char *signalname(int sig); intsignalnumber(const char *name); intsignalnext(int sig);DESCRIPTIONThesignalname() function takes a signal number sig, and returns the name of that signal. The name returned is locale independent, and can be the string representation of one of the signal names from <signal.h> such as SIGHUP, SIGSTOP, SIGKILL, or some similar name, but does not contain the leading "SIG" prefix. The return value ofsignalname() is NULL if sig does not represent a valid signal number, or if the signal number given has no name. Thesignalnumber() function converts the signal name name to the number corresponding to that signal. The name is handled in a case-insensitive manner. Any leading "SIG" prefix in name is ignored. This implementation also accepts rtmax[-n] and rtmin[+n] (where the optional n is a decimal integer between 0 and SIGRTMAX-SIGRTMIN) to refer to the real time signals. Thesignalnumber() function returns the signal number, or zero (0) if the name given does not represent a valid signal. Thesignalnext() function takes a signal number, and returns the number of the next available bigger signal number. When no higher signal numbers remain, it returns zero (0). The parameter sig can be given as zero (0), to obtain the smallest implemented signal number. Thesignalnext() function returns minus one (-1) on error, that is, if the given signal sig is neither a valid signal number nor zero. It returns zero when the input signal number, sig, is the biggest available signal number. Otherwise it returns the signal number of an implemented signal that is larger than sig and such that there are no implemented signals with values between sig and the value returned. Thesignalnext() function can also be used to determine if a non-zero signal number is valid or not (0 is always invalid, but cannot be detected as such this way.) Given the non-zero signal number to check as sig, ifsignalnext() returns anything other than minus one (-1) then sig represents a valid signal number. If the return value is -1 then sig is invalid.SEE ALSOkill(1), intro(2), psignal(3), strsignal(3)HISTORYThesignalname(),signalnext(), andsignalnumber() functions first appeared in NetBSD 8.0. NetBSD 10.99 April 28, 2017 NetBSD 10.99