sigwaitinfo

Autres langues

Langue: ja

Version: 2002-06-07 (openSuse - 09/10/07)

Section: 2 (Appels système)

̾Á°

sigwaitinfo, sigtimedwait - ¥­¥å¡¼¤ËÆþ¤ì¤é¤ì¤¿¥·¥°¥Ê¥ë¤òƱ´ü¤·¤ÆÂÔ¤Ä

½ñ¼°


#include <signal.h>



int sigwaitinfo(const sigset_t *set, siginfo_t *info);



int sigtimedwait(const sigset_t *set, siginfo_t *info, 

                 const struct timespec *timeout);

ÀâÌÀ

sigwaitinfo() ¤Ï set ¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤ë¤Þ¤Ç¡¢ ¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Î¼Â¹Ô¤ò°ì»þÄä»ß¤¹¤ë (¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤ËÂФ·¤Æ set ¤Î¤¦¤Á¤Î¤É¤ì¤«¤Î¥·¥°¥Ê¥ë¤¬´û¤ËÂÔµ¡Ãæ (pending) ¤Ç¤¢¤ë¾ì¹ç¡¢ sigwaitinfo() ¤Ï¤½¤Î¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤Æ¤¹¤°¤ËÌá¤ë)¡£

sigwaitinfo() ¤ÏÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤ò¸Æ¤Ó½Ð¤·¥×¥í¥»¥¹¤Î ÂÔµ¡Ãæ¤Î¥·¥°¥Ê¥ë¤Î¥ê¥¹¥È¤«¤éºï½ü¤·¡¢ ´Ø¿ô¤Î·ë²Ì¤È¤·¤Æ¥·¥°¥Ê¥ëÈÖ¹æ¤òÊÖ¤¹¡£ info °ú¤­¿ô¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷¤µ¤ì¤¿¥·¥°¥Ê¥ë¤Î¾ðÊó¤¬Æþ¤Ã¤¿ siginfo_t ·¿ (sigaction(2) ¤ò»²¾È) ¤Î¹½Â¤ÂΤòÊÖ¤¹¡£

sigwaitinfo() ¤ÇÊÖ¤µ¤ì¤ë¥·¥°¥Ê¥ë¤Ï¡¢Ä̾ï¤Î½çÈÖ¤ÇÇÛÁ÷¤µ¤ì¤ë¡£ ¾ÜºÙ¤Ï signal(7) ¤ò»²¾È¤¹¤ë¤³¤È¡£

sigtimedwait() ¤Ï¡¢ sigwaitinfo() ¤È¼¡¤ÎÅÀ¤ò½ü¤¤¤ÆÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£ ¤³¤Î´Ø¿ô¤Ë¤Ï¤â¤¦ 1 ¤Ä¤Î°ú¤­¿ô timeout ¤¬¤¢¤ê¡¢¥×¥í¥»¥¹¤¬°ì»þÄä»ß¤¹¤ë»þ´Ö¤Î¾å¸Â¤òÄê¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ ¤³¤Î°ú¤­¿ô¤Î·¿¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¢¤ë:


struct timespec {

    long    tv_sec;         /* ÉÃ */

    long    tv_nsec;        /* ¥Ê¥ÎÉà */

}

¤³¤Î¹½Â¤ÂΤΠ2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤¬¤È¤â¤Ë 0 ¤Î¾ì¹ç¡¢¥Ý¡¼¥ê¥ó¥°¤¬¹Ô¤ï¤ì¤ë: sigtimedwait() ¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤ËÂФ·¤Æ ÂÔµ¡¤·¤Æ¤¤¤ë¥·¥°¥Ê¥ë¤Î¾ðÊó¤òÊÖ¤·¤ÆÌá¤ë¤«¡¢ set ¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤âÂÔµ¡¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼¤òÊÖ¤·¤ÆÌá¤ë¡£

ÊÖ¤êÃÍ

À®¸ù¤·¤¿¾ì¹ç¡¢ sigwaitinfo() ¤È sigtimedwait() ¤Ï¥·¥°¥Ê¥ëÈÖ¹æ (¤¹¤Ê¤ï¤Á 0 ¤è¤êÂ礭¤¤¿ô) ¤òÊÖ¤¹¡£ ¼ºÇÔ¤·¤¿¾ì¹ç¡¢2 ¤Ä¤Î´Ø¿ô¤Ï -1 ¤òÊÖ¤·¡¢ errno ¤Ï¥¨¥é¡¼¤òɽ¤¹ÃͤËÀßÄꤵ¤ì¤ë¡£

¥¨¥é¡¼

EAGAIN
set ¤Î¤¦¤Á¤Î¤É¤Î¥·¥°¥Ê¥ë¤â sigtimedwait() ¤Ë»ØÄꤵ¤ì¤¿ timeout ¤Î´ü´ÖÆâ¤ËÇÛÁ÷¤µ¤ì¤Ê¤«¤Ã¤¿¡£
EINTR
¥·¥°¥Ê¥ëÂÔ¤Á¤¬¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤ÆÃæÃÇ (interrupt) ¤µ¤ì¤¿ (¤³¤Î¥Ï¥ó¥É¥é¤Ï set ¤Ë¤¢¤ë¥·¥°¥Ê¥ë°Ê³°¤Î¤â¤Î¤Ç¤¢¤ë)¡£
EINVAL
timeout ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£

½àµò

POSIX.1-2001

Ãí°Õ

Ä̾ï¤Î»ÈÍÑË¡¤Ç¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¥×¥í¥»¥¹¤Ï¤³¤ì¤é¤Î´Ø¿ô¤è¤êÀè¤Ë sigprocmask(2) ¤Î¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê set ¤Ë´Þ¤Þ¤ì¤ë¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤· (¤½¤Î¤¿¤á¤Ë¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤¬¤³¤Î¸å¤Ë³¤¯ sigwaitinfo() ¤ä sigtimedwait() ¤Î¸Æ¤Ó½Ð¤·¤Î´Ö¤ËÇÛÁ÷¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ ¥Ç¥Õ¥©¥ë¥È¤ÎÇÛÃ֤ϹԤï¤ì¤º)¡¢ ¤³¤ì¤é¤Î¥·¥°¥Ê¥ë¤ËÂФ¹¤ë¥Ï¥ó¥É¥é¤ÏÀßÄꤷ¤Ê¤¤¡£ ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ sigwaitinfo() ¤ä sigtimedwait() ¤ò¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É°Ê³°¤Î¥¹¥ì¥Ã¥É¤Ë¤½¤Î¥·¥°¥Ê¥ë¤¬ÇÛÁ÷¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¡¢ Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ç³ºÅö¥·¥°¥Ê¥ë¤ò¥Ö¥í¥Ã¥¯¤¹¤Ù¤­¤Ç¤¢¤ë¡£

POSIX ¤Ç¤Ï sigtimedwait() ¤Î°ú¤­¿ô timeout ¤ÎÃͤò NULL ¤Ë¤·¤¿¾ì¹ç¤Î°ÕÌ£¤ò̤ÄêµÁ¤È¤·¤Æ¤¤¤ë¡£ sigwaitinfo() ¤ò¸Æ¤Ó½Ð¤·¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤È¤·¤Æ¤â¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ ¼ÂºÝ Linux ¤Ç¤Ï¤³¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¡£

´ØÏ¢¹àÌÜ

kill(2), sigaction(2), signal(2), sigpending(2), sigprocmask(2), sigqueue(2), sigsetops(3), signal(7)