sig2str(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

sig2str(3c)

str2sig(3C)              Standard C Library Functions              str2sig(3C)

NAME
       str2sig, sig2str - translation between signal name and signal number

SYNOPSIS
       #include <signal.h>

       int str2sig(const char *str, int *signum);


       int sig2str(int signum, char *str);

DESCRIPTION
       The  str2sig() function translates the signal name str to a signal num‐
       ber, and stores that result in the location referenced by  signum.  The
       name in str can be either the symbol for that signal, without the "SIG"
       prefix,  or  a  decimal  number.  All  the  signal  symbols  defined in
       <sys/signal.h> are recognized. This means that both  "CLD"  and  "CHLD"
       are recognized and return the same signal number, as do both "POLL" and
       "IO".  For access to the signals in the range SIGRTMIN to SIGRTMAX, the
       first four signals match the strings "RTMIN", "RTMIN+1", "RTMIN+2", and
       "RTMIN+3" and the last four match  the  strings  "RTMAX-3",  "RTMAX-2",
       "RTMAX-1", and "RTMAX".


       The  sig2str() function translates the signal number signum to the sym‐
       bol for that signal, without the "SIG" prefix, and stores  that  symbol
       at  the location specified by str. The storage referenced by str should
       be large enough to hold the symbol and a  terminating  null  byte.  The
       symbol  SIG2STR_MAX  defined  by  <signal.h>  gives the maximum size in
       bytes required.

RETURN VALUES
       The str2sig() function returns 0 if it recognizes the signal name spec‐
       ified in str; otherwise, it returns −1.


       The sig2str() function returns 0 if the value signum corresponds  to  a
       valid signal number; otherwise, it returns −1.

EXAMPLES
       Example 1 Sample code using these functions.


         int i;
         char buf[SIG2STR_MAX];      /* storage for symbol */

         str2sig("KILL", &i);        /* stores 9 in i */
         str2sig("9", &i);           /* stores 9 in i */
         sig2str(SIGKILL, buf);      /* stores "KILL" in buf */
         sig2str(9, buf);            /* stores "KILL" in buf */


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe


SEE ALSO
       kill(1), strsignal(3C)

HISTORY
       The sig2str() and str2sig() functions were made public and first  docu‐
       mented in Solaris 2.4.


       The  sig2str() and str2sig() functions were added as private interfaces
       in Solaris 2.0.

Oracle Solaris 11.4               27 Aug 2025                      str2sig(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3