sigaction

SIGACTION(2)               Linux Programmer's Manual              SIGACTION(2)



åå
       sigaction - ã·ã°ãã«ã®åä½ã®ç¢ºèªã¨å¤æ´

æ¸å¼
       #include <signal.h>

       int sigaction(int signum, const struct sigaction *act,
                     struct sigaction *oldact);

   glibc åãã®æ©è½æ¤æ»ãã¯ãã®è¦ä»¶ (feature_test_macros(7)  åç§):

       sigaction(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE

       siginfo_t: _POSIX_C_SOURCE >= 199309L

説æ
       sigaction()  ã·ã¹ãã ã³ã¼ã«ã¯ãç¹å®ã®ã·ã°ãã«ãåä¿¡ããéã® ãã‐
       ã»ã¹ã®åä½ãå¤æ´ããã®ã«ä½¿ç¨ããã (ã·ã°ãã«ã®æ¦è¦ã«ã¤ãã¦ã¯ signal(7)  ãåç§)ã

       signum ã«ã¯ã SIGKILL 㨠SIGSTOP 以å¤ã®æå¹ãªã·ã°ãã«ãã©ãã§ãæå®ã§ããã

       act ã NULL 以å¤ã§ããã°ãã·ã°ãã« signum ã®æ°ããåä½ (action) ã¨ã㦠act ãè¨‐
       å®ãããã oldact ã NULL ã§ãªããã°ãä»ã¾ã§ã®åä½ã oldact ã«æ ¼ç´ãããã

       sigaction æ§é ä½ã¯ä»¥ä¸ã®ãããªæãã«å®ç¾©ãããã

           struct sigaction {
               void     (*sa_handler)(int);
               void     (*sa_sigaction)(int, siginfo_t *, void *);
               sigset_t   sa_mask;
               int        sa_flags;
               void     (*sa_restorer)(void);
           };

       ã¢ã¼ããã¯ãã£ã«ãã£ã¦ã¯å±ç¨ä½ (union) ãç¨ãããã¦ããããã®å ´åã«ã¯ sa_handler ã¨
       sa_sigaction ã®ä¸¡æ¹ãåæã«å²ãå½ã¦ããã¨ã¯ã§ããªãã

       sa_restorer è¦ç´ ã¯å»æ¢äºå®ã§ãã使ç¨ãã¹ãã§ã¯ãªãã POSIX ã«ã¯ sa_restorer
       è¦ç´ ã«é¢ããè¦å®ã¯ãªãã

       sa_handler 㯠signum ã«å¯¾å¿ããåä½ãæå®ãããã®ã§ã ããã©ã«ãã®åä½ãè¡ã SIG_DFLã
       ãã®ã·ã°ãã«ãç¡è¦ãã SIG_IGNã ã·ã°ãã«ãã³ãã©é¢æ°ã¸ã®ãã¤ã³ã¿ãè¨å®ã§ããã
       ã·ã°ãã«ãã³ãã©é¢æ°ã®å¼ãæ°ã¯ä¸ã¤ã§ãããã·ã°ãã«çªå·ãå¼ãæ°ã¨ã㦠渡ãããã

       sa_flags ã« SA_SIGINFO ãæå®ãããå ´åã (sa_handler ã§ã¯ãªã) sa_sigaction
       ã«ãã signum ã«å¯¾å¿ããã·ã°ãã«ãã³ãã©é¢æ°ãæå®ã
       ãããæå®ãããé¢æ°ã¯ãæåã®å¼ãæ°ã¨ãã¦ã·ã°ãã«çªå·ããäºçªç®ã®å¼ã æ°ã¨ãã¦
       siginfo_t ã¸ã®ãã¤ã³ã¿ããä¸çªç®ã®å¼ãæ°ã¨ã㦠(void * ã«ãã£ã¹ããã)
       ucontext_t ã¸ã®ãã¤ã³ã¿ãåãã¨ãã (ä¸è¬çã«ã¯ã
       ãã³ãã©é¢æ°ã®ä¸çªç®ã®å¼ãæ°ã使ç¨ãããªããucontext_t ã«ã¤ãã¦ã® 詳ããæå ±ã¯
       getcontext(3) ãåç§ã)

       sa_mask ã¯ãã·ã°ãã«ã»ãã³ãã©å®è¡ä¸ã«ç¦æ¢ (block) ãã¹ãã·ã°ãã«ã®ãã¹ã¯ãæå®ãã
       (ãã³ãã©å®è¡ä¸ã®ã·ã°ãã«ã®ç¦æ¢ã¯ãã·ã°ãã«ã»ãã³ãã©ãèµ·åãããã¹ã¬ãã
       ã®ã·ã°ãã«ã®ãã¹ã¯ã«è¿½å ãããã¨ã§è¡ããã)ã ããã«ã SA_NODEFER
       ãã©ã°ãæå®ããã¦ããªãå ´åã¯ããã³ãã©ãèµ·åãããã£ããã¨ãªã ã·ã°ãã«ã«ã sa_mask
       ãé©ç¨ãããã

       sa_flags ã¯ã·ã°ãã«ã»ãã³ãã©ã®åä½ãå¤æ´ããããã®ãã©ã°ã®éåãæå®ããã sa_flags
       ã«ã¯ã以ä¸ã«ç¤ºããã©ã°ã® (0 å以ä¸ã®) è«çåãã¨ã£ããã®ãæå®ããã

           SA_NOCLDSTOP
                  signum ã SIGCHLD ã®å ´åã åããã»ã¹ãåæ¢ããã (åããã»ã¹ã SIGSTOP,
                  SIGTSTP, SIGTTIN, SIGTTOU ãåããã¨ã) åéããã (åããã»ã¹ã SIGCONT
                  ãåããã¨ã) ããã¨ãã« SIGCHLD ã®éç¥ãåããªãã ãã®ãã©ã°ã¯ã SIGCHLD
                  ã«å¯¾ãã¦ãã³ãã©ãè¨å®ããéã«ã®ã¿æå³ãæã¤ã

           SA_NOCLDWAIT (Linux 2.6 以é)
                  (Linux 2.6 以é)  signum ã SIGCHLD ã®å ´åãåãã‐
                  ã»ã¹ãçµäºããã¨ãã« åããã»ã¹ãã¾ã³ãããã»ã¹ã«å¤åãããªã (waitpid(2)
                  ãåç§)ã ãã®ãã©ã°ã¯ã SIGCHLD ã«å¯¾ãã¦ãã³ãã©ãè¨‐
                  å®ããéããããã¯ãã®ã·ã°ãã«ã®å¦çæ¹æ³ã SIG_DFL ã«è¨‐
                  å®ããéã«ã®ã¿æå³ãæã¤ã

                  SIGCHLD ã«å¯¾ãã¦ãã³ãã©ãè¨å®ããéã« SA_NOCLDWAIT
                  ãã©ã°ãã»ããããå ´åã åããã»ã¹ãçµäºããéã« SIGCHLD
                  ã·ã°ãã«ãçæããããã©ããã¯ã POSIX.1 ã§ã¯è¦å®ããã¦ããªãã Linux
                  ã§ã¯ããã®ç¶æ³ã§ SIGCHLD ã·ã°ãã«ã¯çæãããã
                  ããã¤ãã®ä»ã®å®è£ã§ã¯çæãããªãã

           SA_NODEFER
                  ããèªèº«ã®ã·ã°ãã«ã»ãã³ãã©ã¼ã®åé¨ã«ããæã§ã
                  ãã®ã·ã°ãã«ããã¹ã¯ããªãããã«ããã ãã®ãã©ã°ã¯ã·ã°ãã«ãã³ãã©ãè¨‐
                  å®ããéã«ã®ã¿æå³ãæã¤ã SA_NOMASK ã¯ãã®ãã©ã°ã¨åãæå³ã ããå»æ‐
                  ¢ããã¦ãããéæ¨æºã§ããã

           SA_ONSTACK
                  sigaltstack(2)
                  ã§æä¾ãããå¥ã®ã·ã°ãã«ã»ã¹ã¿ãã¯ã§ã·ã°ãã«ãã³ãã©ãå¼ã³åºãã
                  å¥ã®ã·ã°ãã«ã»ã¹ã¿ãã¯ãå©ç¨å¯è½ã§ãªããã°ãããã©ã«ãã®ã¹ã¿ãã¯ã
                  使ç¨ãããã ãã®ãã©ã°ã¯ã·ã°ãã«ãã³ãã©ãè¨å®ããéã«ã®ã¿æå³ãæã¤ã

           SA_RESETHAND
                  ã·ã°ãã«ãã³ãã©ãè¨å®ããéã«ãã·ã°ãã«ã®åä½ãããã©ã«ãã«æ»ãã
                  ãã®ãã©ã°ã¯ã·ã°ãã«ãã³ãã©ãè¨å®ããéã«ã®ã¿æå³ãæã¤ã SA_ONESHOT
                  ã¯ãã®ãã©ã°ã¨åãæå³ã ããå»æ¢ããã¦ãããéæ¨æºã§ããã

           SA_RESTART
                  ããã¤ãã®ã·ã¹ãã ã³ã¼ã«ãã·ã°ãã«ã®éç¥ã®åå¾ã§åéã§ããããã«ãã¦ã BSD
                  ã·ã°ãã«æ¹å¼ (semantics) ã¨äºææ§ã®ããåä½ãæä¾ããã
                  ãã®ãã©ã°ã¯ã·ã°ãã«ãã³ãã©ãè¨å®ããéã«ã®ã¿æå³ãæã¤ã signal(7)
                  ã«æ¸ããã¦ããã·ã¹ãã ã³ã¼ã«ã®åéã«é¢ããè°è«ãåç§ã®ãã¨ã

           SA_SIGINFO (Linux 2.2 以é)
                  ã·ã°ãã«ãã³ãã©ã¯ä¸ã¤ã§ã¯ãªããä¸ã¤ã®å¼ãæ°ãæã¤ããã®å ´åã¯
                  sa_handler ã®ãããã« sa_sigaction ãè¨å®ããªããã°ãªããªã
                  ãã®ãã©ã°ã¯ã·ã°ãã«ãã³ãã©ãè¨å®ããéã«ã®ã¿æå³ãæã¤ã

       sa_sigaction ã®ãã©ã¡ã¼ã¿ siginfo_t ã¯ä»¥ä¸ã®è¦ç´ ãæã¤æ§é ä½ã§ãã:

           siginfo_t {
               int      si_signo;    /* Signal number */
               int      si_errno;    /* An errno value */
               int      si_code;     /* Signal code */
               int      si_trapno;   /* Trap number that caused
                                        hardware-generated signal
                                        (unused on most architectures) */
               pid_t    si_pid;      /* Sending process ID */
               uid_t    si_uid;      /* Real user ID of sending process */
               int      si_status;   /* Exit value or signal */
               clock_t  si_utime;    /* User time consumed */
               clock_t  si_stime;    /* System time consumed */
               sigval_t si_value;    /* Signal value */
               int      si_int;      /* POSIX.1b signal */
               void    *si_ptr;      /* POSIX.1b signal */
               int      si_overrun;  /* Timer overrun count; POSIX.1b timers */
               int      si_timerid;  /* Timer ID; POSIX.1b timers */
               void    *si_addr;     /* Memory location which caused fault */
               long     si_band;     /* Band event (was int in
                                        glibc 2.3.2 and earlier) */
               int      si_fd;       /* File descriptor */
               short    si_addr_lsb; /* Least significant bit of address
                                        (since Linux 2.6.32) */
           }

       si_signo, si_errno, si_code ã¯å¨ã¦ã®ã·ã°ãã«ã«å¯¾ãã¦å®ç¾©ããã¦ãã
       (si_errno 㯠Linux ã§ã¯ä¸è¬çã«ã¯ä½¿ç¨ãããªã)ã æ§é ä½ã®æ®ãã®é¨åã¯ãå±ç¨ä½
       (union) ã«ãªã£ã¦ãããããããªãã
       ãã®å ´åã¯è©²å½ããã·ã°ãã«ã«ããã¦æå³ã®ãããã£ã¼ã«ãã®ã¿ãèªã¿è¾¼ã ãã¨ãã§ããã

       * Signals sent with kill(2)  and sigqueue(3)  fill in si_pid and
         si_uid.  In addition, signals sent with sigqueue(3)  fill in si_int
         and si_ptr with the values specified by the sender of the signal; see
         sigqueue(3)  for more details.

       * POSIX.1b ã¿ã¤ã (Linux 2.6 以é) 㯠si_overrun 㨠si_timerid ã è¨å®ããã
         si_timerid ãã£ã¼ã«ãã¯ã«ã¼ãã«ãã¿ã¤ããç¹å®ããã®ã« 使ç¨ããåé¨ ID ã§ããã
         timer_create(2) ãè¿ãã¿ã¤ã ID ã¨åãã§ã¯ãªãã si_overrun
         ãã£ã¼ã«ãã¯ã¿ã¤ããåãåã£ãåæ°ã§ããã ãã㯠timer_getoverrun(2)
         ã®å¼ã³åºãã§åå¾ã§ããæå ±ã¨åãã§ããã ãããã®ãã£ã¼ã«ãã¯éæ¨æºã§ Linux
         ã«ããæ¡å¼µã§ããã

       * Signals sent for message queue notification (see the description of
         SIGEV_SIGNAL in mq_notify(3))  fill in si_int/si_ptr, with the
         sigev_value supplied to mq_notify(3); si_pid, with the process ID of
         the message sender; and si_uid, with the real user ID of the message
         sender.

       * SIGCHLD 㯠si_pid, si_uid, si_status, si_utime, si_stime ãè¨å®ããåãã‐
         ã»ã¹ã«é¢ããæå ±ãæä¾ããã si_pid ãã£ã¼ã«ãã¯åããã»ã¹ã®ããã»ã¹ ID ã§ã si_uid
         ãã£ã¼ã«ãã¯åããã»ã¹ã®å®ã¦ã¼ã¶ ID ã§ããã si_stime ãã£ã¼ã«ãã«ã¯ã (si_code
         ã CLD_EXITED ã®å ´åã¯) åãã‐
         ã»ã¹ã®çµäºã¹ãã¼ã¿ã¹ãããã以å¤ã®å ´åã¯ç¶æãå¤åããåå ã¨
         ãªã£ãã·ã°ãã«çªå·ãæ ¼ç´ãããã si_utime 㨠si_stime ã«ã¯åãã‐
         ã»ã¹ã使ç¨ããã¦ã¼ã¶ CPU æéã¨ã· ã¹ãã  CPU æéãããããæ ¼ç´ãããã(getrusage(2)
         ã time(2) 㨠ç°ãªã) ãããã®ãã£ã¼ã«ãã«ã¯ wait å¾ã¡ã®åããã»ã¹ã«ãã使ç¨ãããæ
         éã¯å«ã¾ããªãã 2.6 ããå㨠2.6.27 以éã®ã«ã¼ãã«ã§ã¯ã ãããã®ãã£ã¼
         ã«ãã«æ ¼ç´ããã CPU æéã®åä½ã¯ sysconf(_SC_CLK_TCK) ã§ããã 2.6.27 ããåã®
         2.6 ç³»ã®ã«ã¼ãã«ã§ã¯ããã°ãããã ãããã®ãã£ã¼ã«ãã® CPU æéã®åä½ã
         (ã«ã¼ãã«ã®ã³ã³ãã£ã°ã§æå®ããã) ã·ã¹ãã ã® jiffy 㧠ãã£ã (time(7) åç§)ã

       * SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP fill in si_addr with the
         address of the fault.  On some architectures, these signals also fill
         in the si_trapno filed.  Some suberrors of SIGBUS, in particular
         BUS_MCEERR_AO and BUS_MCEERR_AR, also fill in si_addr_lsb.  This
         field indicates the least significant bit of the reported address and
         therefore the extent of the corruption.  For example, if a full page
         was corrupted, si_addr_lsb contains log2(sysconf(_SC_PAGESIZE)).
         BUS_MCERR_* and si_addr_lsb are Linux-specific extensions.

       * SIGIO/SIGPOLL (the two names are synonyms on Linux)  fills in si_band
         and si_fd.  The si_band event is a bit mask containing the same
         values as are filled in the revents field by poll(2).  The si_fd
         field indicates the file descriptor for which the I/O event occurred.

       si_code ã¯ããã®ã·ã°ãã«ãéä¿¡ãããçç±ã示ãå¤ã§ãã (ããããã¹ã¯ã§ã¯ãªã)ã
       以ä¸ã®ãªã¹ãã«ãã©ã®ã·ã°ãã«ã®å ´åã§ã si_code
       ã«å¥ãããå¤ããã·ã°ãã«ãçæãããçç±ã¨ã¨ãã«è¨è¼ããã

           SI_USER        kill(2)

           SI_KERNEL      ã«ã¼ãã«ã«ããéä¿¡ããã

           SI_QUEUE       sigqueue(3)

           SI_TIMER       POSIX ã¿ã¤ããæºäºãã

           SI_MESGQ       POSIX ã¡ãã»ã¼ã¸ãã¥ã¼ã®ç¶æãå¤åãã (Linux 2.6.6 以é)ã
                          mq_notify(3)åç§ã

           SI_ASYNCIO     éåæ IO (AIO) ãå®äºãã

           SI_SIGIO       Queued SIGIO (only in kernels up to Linux 2.2; from
                          Linux 2.4 onward SIGIO/SIGPOLL fills in si_code as
                          described below).

           SI_TKILL       tkill(2)  ã¾ã㯠tgkill(2)  (Linux 2.4.19 以é)

       SIGILL ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           ILL_ILLOPC     ä¸æ£ãªå½ä»¤ã³ã¼ã (opcode)

           ILL_ILLOPN     ä¸æ£ãªãªãã©ã³ã

           ILL_ILLADR     ä¸æ£ãªã¢ãã¬ãã·ã³ã°ã¢ã¼ã

           ILL_ILLTRP     ä¸æ£ãªãã©ãã

           ILL_PRVOPC     ç¹æ¨©ãå¿è¦ãªå½ä»¤ã³ã¼ã (opcode)

           ILL_PRVREG     ç¹æ¨©ãå¿è¦ãªã¬ã¸ã¹ã¿

           ILL_COPROC     ã³ããã»ããµã®ã¨ã©ã¼

           ILL_BADSTK     åé¨ã¹ã¿ãã¯ã¨ã©ã¼

       SIGFPE ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           FPE_INTDIV     æ´æ°ã® 0 ã«ããé¤ç®

           FPE_INTOVF     æ´æ°ã®ãªã¼ãã¼ããã¼

           FPE_FLTDIV     æµ®åå°æ°ç¹ã® 0 ã«ããé¤ç®

           FPE_FLTOVF     æµ®åå°æ°ç¹ã®ãªã¼ãã¼ããã¼

           FPE_FLTUND     æµ®åå°æ°ç¹ã®ã¢ã³ãã¼ããã¼

           FPE_FLTRES     æµ®åå°æ°ç¹ã®ä¸æ£ç¢ºãªæ¼ç®çµæ (inexact result)

           FPE_FLTINV     æµ®åå°æ°ç¹ã®ä¸æ£ãªæä½

           FPE_FLTSUB     ç¯å²å¤ã®æ·»å (subscript)

       SIGSEGV ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           SEGV_MAPERR    ãªãã¸ã§ã¯ãã«ãããã³ã°ããã¦ããªãã¢ãã¬ã¹

           SEGV_ACCERR    ãããã³ã°ããããªãã¸ã§ã¯ãã«å¯¾ããã¢ã¯ã»ã¹è¨±å¯ããªã

       SIGBUS ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           BUS_ADRALN     ä¸æ£ãªã¢ãã¬ã¹ã»ã¢ã©ã¤ã¡ã³ã (alignment)

           BUS_ADRERR     åå¨ããªãç©çã¢ãã¬ã¹

           BUS_OBJERR     ãªãã¸ã§ã¯ãåºæã®ãã¼ãã¦ã§ã¢ã¨ã©ã¼

           BUS_MCEERR_AR (Linux 2.6.32 以é)
                          Hardware memory error consumed on a machine check;
                          action required.

           BUS_MCEERR_AO (Linux 2.6.32  以é)
                          Hardware memory error detected in process but not
                          consumed; action optional.

       SIGTRAP ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           TRAP_BRKPT     ããã»ã¹ã®ãã¬ã¼ã¯ãã¤ã³ã

           TRAP_TRACE     ããã»ã¹ã®ãã¬ã¼ã¹ã»ãã©ãã

           TRAP_BRANCH (Linux 2.4 以é)
                          process taken branch trap

           TRAP_HWBKPT (Linux 2.4 以é)
                          hardware breakpoint/watchpoint

       SIGCHLD ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ãæå®ã§ãã:

           CLD_EXITED     åããã»ã¹ãçµäºãã (exited)

           CLD_KILLED     åããã»ã¹ã kill ããã

           CLD_DUMPED     åããã»ã¹ãç°å¸¸çµäºãã

           CLD_TRAPPED    ãã¬ã¼ã¹å¯¾è±¡ã®åããã»ã¹ããã©ãããä¸ãã

           CLD_STOPPED    åããã»ã¹ãåæ¢ (stop) ãã

           CLD_CONTINUED  åæ¢ãã¦ããåããã»ã¹ãåéãã (Linux 2.6.9 以é)

       SIGIO/SIGPOLL ã·ã°ãã«ã®å ´åã si_code ã«ã¯ä»¥ä¸ã®å¤ã æå®ã§ãã:

           POLL_IN        å¥åãã¼ã¿ãå©ç¨å¯è½

           POLL_OUT       åºåãããã¡ãå©ç¨å¯è½

           POLL_MSG       å¥åã¡ãã»ã¼ã¸ãå©ç¨å¯è½

           POLL_ERR       I/O ã¨ã©ã¼

           POLL_PRI       é«åªåã®å¥åãå©ç¨å¯è½

           POLL_HUP       ããã¤ã¹ãæ¥ç¶ããã¦ããªã

è¿ãå¤
       sigaction()  ã¯æåããã° 0 ãè¿ããã¨ã©ã¼ãªãã° -1 ãè¿ãã

ã¨ã©ã¼
       EFAULT act ã oldact ãæãã¦ããã¡ã¢ãªãæ£ããããã»ã¹ã®ã¢ãã¬ã¹ç©ºéã«ãªãã

       EINVAL ç¡å¹ãªã·ã°ãã«ãæå®ããããè£è¶³ (catch) ãããç¡è¦ãããã§ããªã ã·ã°ãã«ã§ãã
              SIGKILL ã SIGSTOP ã«å¯¾ããåä½ãå¤æ´ãããã¨ããå ´åã«ãçºçããã

æºæ
       POSIX.1-2001, SVr4.

注æ
       fork(2) çµç±ã§ä½æãããåããã»ã¹ã¯ã親ããã»ã¹ã®ã·ã°ãã«ã®å¦çæ¹æ³ã®
       ã³ãã¼ãç¶æ¿ããã execve(2) ã®åå¾ã§ããã³ãã©ãè¨‐
       å®ããã¦ããã·ã°ãã«ã®å¦çæ¹æ³ã¯ããã©ã«ãã«ãªã»ããããã ç¡è¦ãè¨‐
       å®ããã¦ããã·ã°ãã«ã®å¦çæ¹æ³ã¯å¤æ´ããããã®ã¾ã¾ã¨ãªãã

       POSIX ã§ã¯ã kill(2)  ã raise(3)  ã§çæã§ããªãã·ã°ãã« SIGFPE, SIGILL,
       SIGSEGV ãç¡è¦ (ignore) ããå ´åããã®å¾ã®åä½ã¯æªå®ç¾©ã§ããã ã¼ã‐
       ã«ããæ´æ°å²ãç®ã®çµæã¯æªå®ç¾©ã¨ãªãã ã¢ã¼ããã¯ãã£ã¼ã«ãã£ã¦ã¯ããã®ã¨ã SIGFPE
       ã·ã°ãã«ãçæãããã (åæ§ã«è² ã®æ大æ´æ°ã -1 ã§å²ã㨠SIGFPE ãçæããããããããªã)
       ãã®ã·ã°ãã«ãç¡è¦ããã¨ç¡éã«ã¼ãã«é¥ããããããªãã

       POSIX.1-1990 ã§ã¯ SIGCHLD ã« SIG_IGN ãè¨å®ãããã¨ãèªãã¦ããªãã POSIX.1-2001
       ã§ã¯èªãããã¦ããã SIGCHLD ãç¡è¦ãããã¨ã§ã¾ã³ãããã»ã¹ã®çæãé²æ¢ãããã¨ãã§ãã
       (wait(2)  ãåç§)ã ããã«ãBSD 㨠SystemV ã§ã¯ SIGCHLD
       ãç¡è¦ããéã®åä½ãç°ãªã£ã¦ããã ãã®ãããå®å¨ã«ç§»æ¤æ§ãããæ¹æ³ã§ãçµäºããåãã‐
       ã»ã¹ãã¾ã³ãã«ãªããªãã㨠ãä¿è¨¼ããã«ã¯ã SIGCHLD ã·ã°ãã«ãè£è¶³ãã wait(2)
       ãªã©ãå®è¡ãããããªãã

       POSIX.1-1990 ã®ä»æ§ã§ã¯ SA_NOCLDSTOP ã®ã¿ãå®ç¾©ããã¦ããã POSIX.1-2001
       ã§ã¯ SA_NOCLDWAIT, SA_RESETHAND, SA_NODEFER, SA_SIGINFO ã追å ãããã UNIX
       ã®å¤ãå®è£ã§åããã¢ããªã±ã¼ã·ã§ã³ã§ã ä»ã® sa_flags
       ãã©ã°ã使ç¨ããã¨ç§»æ¤æ§ãä¸ããã

       SA_RESETHAND ãã©ã°ã¯ SVr4 ã®åãååã®ãã©ã°ã¨äºææ§ãããã

       SA_NODEFER ãã©ã°ã¯ 1.3.9 以éã®ã«ã¼ãã«ã§ã¯åãååã® SVr4
       ã®ãã©ã°ã¨äºææ§ãããã ãã以åã® Linux ã«ã¼ãã«ã®å®è£ã§ã¯ããã®ãã©ã°ãè¨‐
       å®ãã¦ããã·ã°ãã« ã ãã§ãªããã©ã®ã·ã°ãã«ã§ãåãããã¨ã許ãã¦ãã (å®éã«ã¯ sa_mask
       ã®è¨å®ã«ããç¡å¹ã«ã§ãã)ã

       sigaction()  ã®äºçªç®ã®å¼ãæ°ã« NULL
       ãæå®ãã¦å¼ã³åºãã¨ãç¾å¨ã®ã·ã°ãã«ãã³ãã©ã確èªãã
       ãã¨ãã§ãããã¾ããäºçªç®ã¨ä¸çªç®ã®å¼ãæ°ã NULL ã«ã¦å¼ã³åºããã¨ã§ã
       æå®ãããã·ã°ãã«ãç¾å¨ã®ãã·ã³ã§ä½¿ãããã©ãããã§ãã¯ã§ããã

       SIGKILL ã SIGSTOP ã (sa_mask ã«æå®ãã¦) ç¦æ¢ãããã¨ã¯ã§ããªãã ç¦æ‐
       ¢ãããã¨ãã¦ãé»ã£ã¦ç¡è¦ãããã

       ã·ã°ãã«éåã®æä½ã«é¢ãã詳細㯠sigsetops(3)  ãåç§ã®ãã¨ã

       ã·ã°ãã«ãã³ãã©åããå®å¨ã«å¼ã³åºããã¨ãã§ããã async-signal-safe functions
       (éåæã·ã³ã°ã«ã§å®å¨ãªé¢æ°) ã® ãªã¹ãã«ã¤ãã¦ã¯ signal(7)  ãåç§ã

   éå¬å¼
       SA_SIGINFO ãå°å¥ãããåã¯ã struct sigcontext åã®äºçªç®ã®å¼ãæ°ã¨ä¸ç·ã«
       sa_handler ã使ç¨ãããã¨ã§ã ããã¤ãã®è¿½å ã®æå ±ãå¥æãããã¨ãã§ããã
       詳細ã«ã¤ãã¦ã¯ Linux ã«ã¼ãã«ã½ã¼ã¹ã®é¢é£é¨åãè¦ã¦ã»ããã
       ç¾å¨ã¯ãã®ä½¿ç¨æ³ã¯å»æ¢ããã¦ããã

ãã°
       2.6.13 以åã®ã«ã¼ãã«ã§ã¯ã sa_flags ã« SA_NODEFER ãæå®ããå ´åã
       ãã³ãã©ãå®è¡ä¸ã«ééãããã·ã°ãã«èªèº«ããã¹ã¯ãããªããªãã ãã§ãªãã sa_mask
       ã«æå®ãããã·ã°ãã«ããã¹ã¯ãããªããªãã ãã®ãã°ã¯ãã«ã¼ãã« 2.6.14 ã§ä¿®æ£ãããã

ä¾
       mprotect(2)  åç§ã

é¢é£é ç®
       kill(1), kill(2), killpg(2), pause(2), sigaltstack(2), signal(2),
       signalfd(2), sigpending(2), sigprocmask(2), sigsuspend(2), wait(2),
       raise(3), siginterrupt(3), sigqueue(3), sigsetops(3), sigvec(3),
       core(5), signal(7)

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.51 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



Linux                             2013-02-12                      SIGACTION(2)