ѧϰlinuxÏÂc±à³ÌµÄÐźÅÕâÒ»Õ£¬×öÒ»×ö±Ê¼Ç°É¡£
³£ÓõÄ4¸ö·¢³öÐźŵÄϵͳº¯Êýkill,raise,alarm,setitimer¡£
killÏòÖ¸¶¨µÄ½ø³Ì·¢ËÍÐźÅ
raiseÏò×Ô¼º·¢ËÍsigÐźÅ
alarmÊǶ¨Ê±Æ÷£¬µÈ¹æ¶¨Ê±¼äµ½ÁËÏò×Ô¼º·¢ËÍSIGALRMÐźš£
setitimer,ÉèÖÃÒ»¶Îʱ¼äʹµÃ³ÌÐò¼ä¸ôÖ´ÐС££¨¾ßÌåûÓùý£¬²»ËµºÜÁ˽⣩
ÐźŲÙ×÷
º¯Êý
½âÊÍ
int sigemptyset(sigset_t *set)
³õʼ»¯ÐźÅset£¬½«ÆäÉèΪ¿Õ
int sigfillset(sigset_t *set)
³õʼ»¯set£¬½«ÆäÉèΪËùÓÐÐźŵļ¯ºÏ
int sigaddset(sigset_t *set,int signo)
½«signo¼ÓÈëset¼¯ºÏÖÐ
int sigdelset(sigset_t *set,int signo)
½«signo´ÓsetÖÐɾ³ý
int sigismember(sigset_t *set,int signo)
²éѯsignoÊÇ·ñÔÚsetÖÐ
int sigprocmask(int how,const sigset_t *set,sigset_t *oset)
½«Ö¸¶¨Ðźż¯ºÏ¼ÓÈë½ø³Ì×èÈû¼¯ºÏÖУ¬osetÊDZ£´æÔÀ´µÄ×èÈû¼¯ºÏ£¬Ò»°ãΪnull£¬howÊǺ¯Êý²Ù×÷·½Ê½£¬SIG_BLOCK£ºÔö¼ÓÐźż¯ºÏµ½µ±Ç°¶ÓÁÐÖУ»SIG_UNBLOCK£º´Óµ±Ç°×èÈû¼¯ºÏÖÐɾ³ýÒ»¸öÐźż¯ºÏ£»SIG_SETMASK£ºÉèÖõ±Ç°Ðźż¯ºÏΪ×èÈû¼¯ºÏ
int sigaction(int signo,const struct sigaction *act,struct sigaction *oact)
Öض¨ÒåÐźŷ¢Ë͵Ķ¯×÷£¬Í¬ÉÏ£¬actΪÌí¼ÓµÄ¶¯×÷£¬oactΪ±»Ìæ»»±£´æµÄ¶¯×÷
int pause(void )
¹ÒÆðµ±Ç°½ø³ÌÖ±µ½Ðźŷ¢Éú
int sigsuspend(const sigset_t *sigmask)
¹ÒÆð½ø³Ì£¬µ÷ÓõÄʱºòÓÃsigmaskÈ¡´úµ±Ç°×èÈû¼¯ºÏ
struct sigaction{
void (*sa_handler)(int signo);
void (*sa_sigaction)(int siginfo_t *info,void *act);
sigset_t sa_mask;
int sa_flags;
void (*sa_restore)(void);
}
×¢£ºsignoÖÐÐźŲ鿴man 7 signal
¹ØÓÚÕâ¸ö£¬Õâ벩Ö÷½²µÄ±È½ÏÏêϸ£º
¡¡