linux ÐźŴ¦Àí
Ôø×ö¹ýsignalÏà¹ØµÄÒ»µã¶ù¿ª·¢£¬Ì¸Ì¸ÎÒµÄһЩÀí½â¡£
Ê×ÏÈ£¬ÐèÒªÀí½â¼¸¸ösignalÏà¹ØµÄº¯Êý¡£
sigaddset(sigset_t* sigSet, int sigNum ) : ½«ÐźÅsigNum Ìí¼Óµ½Ðźż¯ sigSet ÖУ»
sigdelset(sigset_t* sigSet, int sigNum) : ½«ÐźŠsigNum ´ÓÐźż¯ sigSet ÖÐɾ³ý£»
sigemptyset(sigset_t* sigSet) : Çå¿ÕÐźż¯£»
sigfillset(sigset_t* sigSet) : ÔÚÐźż¯Öдò¿ªËùÓеÄÐźš£
µ«ÊÇÕâ¸öʱºòÖ»ÊǶ¨ÒåºÃÁËÈç´ËÒ»¸öÐźż¯£¬»¹ÓжÔÐźŵIJÙ×÷º¯Êý£º
pthread_sigmask(int opCode, sigset_t* sigSet, sigset_t* oldSigSet) :
opCode Ö¸¶¨ÁËÈçºÎ¶Ô sigSet ÀïµÄÐźŽøÐд¦Àí¡£opCode ÓÐÈý¸öÖµ: SIG_BLOCK
(½«sigSetÖеÄÐźżӵ½µ±Ç°Ï̵߳ÄÆÁ±Î¼¯ÖÐ)£¬SIG_UNBLOCK (½«sigSet
ÖеÄÐźŴӵ±Ç°Ïß³ÌÆÁ±Î¼¯ÖÐɾ³ý)£¬SIG_SETMASK (½«sigSet ÉèΪµ±Ç°Ï̵߳ÄÆÁ±Î¼¯)¡£ ÈôoldSigSet !=
NULL£¬Ôò½«Ö®Ç°µÄÐźÅÆÁ±Î¼¯´æÈëÆäÖС£
ÁíÍ⻹Óиöº¯Êý sigprocmask() Ò²ÓÐÀàËƹ¦ÄÜ¡£Çø±ðÊÇ£ºpthread_sigmask()
ÊÇÏ߳̿⺯Êý£¬ÓÃÓÚ¶àÏ߳̽ø³Ì¡£sigprocmask() ÊǾɵÄʵÏÖ£¬ÓÃÓÚµ¥Ï̵߳Ľø³Ì¡£
sigwait(sigset_t* sigSet, int* sigNum) : µ±Ç°Ï̵߳ȴý sigSet
ÖеÄÐźš£Ã»Óⶻñµ½ÐźÅʱ£¬Ï̹߳ÒÆ𣻵±²¶»ñµ½Ê±£¬º¯Êý·µ»Ø£¬²¢½«ÐźÅÖµ´æÈë sigNum¡£
sigaction(int sigNum, sigaction* newAct, sigaction* oldAct) : ²¶»ñÐźÅ
sigNum£¬²¢µ÷ÓÃÏàÓ¦µÄ´¦Àíº¯Êý(¶¨ÒåÔÚ newAct ÖÐ)¡£
ËäÈ»sigwait() ºÍ sigaction() ¶¼ÊÇÓÃÓÚ²¶»ñÐźţ¬µ«Á½Õß»¹ÊÇÓнϴóÇø±ð£ºsigwait()
ÊÇ×èÈûµÄ£¬Ï̻߳áÒ»Ö±¹ÒÆðÖ±µ½²¶»ñµ½Ðźţ¬²¢ÇÒ¶ÔÐźŵĴ¦ÀíÊǶ¨ÒåÔÚ
sigwait()ºóµÄ£¬Ö»»áÔÚµ±Ç°Ïß³ÌÄÚÖ´ÐУ»¶øsigaction()ÊÇ·Ç×èÈûµÄ£¬µ±Ðźű»²¶»ñʱ£¬»áÓɽø³ÌÄÚµ±Ç°±»µ÷¶Èµ½µÄÏß³ÌÀ´Ö´Ðд¦Àíº¯Êý(ºÃ
ÏñÊÇ£¬not very sure...)£¬±»ÄĸöÏ̴߳¦ÀíÊÇËæ»úµÄ¡£
ËùÒÔ£¬sigaction()ÊÊÓÃÓÚ¶ÔʵʱÐÔÒªÇóºÜ¸ßµÄʱºò¡£¶øÔÚÆÕͨÇé¿öϽ¨ÒéʹÓÃsigwait()£¬ÒòΪÆä¾ßÓнϺõĿɿØÐÔ¡£
ÁíÍ⣬»¹ÐèҪעÒâµÄÊÇ£¬SIG_KILL(´ó¼ÒÓ¦¸Ã¶¼Óùýkill -9 °É) ºÍ SIG_STOP ÊDz»Äܱ»Óû§ÆÁ±Î»ò²¶»ñµÄ¡£
ºÃÁË£¬µ±Àí½âÁËÕ⼸¸öº¯Êýºó£¬¿ÉÒÔ×Ô¼ºÊÔ×ÅÀ´¶ÔÐźŽøÐд¦ÀíÁË¡£¶ÔÓÚlzµÄÐèÇ󣬼òµ¥¾ÙÀýÈçÏ£º
sigset_t blockSet, waitSet;
int sigNum;
Ïà¹ØÎĵµ£º
LinuxϵͳÏ»ù±¾ÃüÁ ÒªÇø·Ö´óСд uname ÏÔʾ°æ±¾ÐÅÏ¢£¨Í¬win2KµÄ ver£© dir ÏÔʾµ±Ç°Ä¿Â¼Îļþ,ls -al ÏÔʾ°üÀ¨Òþ²ØÎļþ£¨Í¬win2KµÄ dir£© pwd ²éѯµ±Ç°ËùÔÚµÄĿ¼λÖà cd cd¡¡..»Øµ½ÉÏÒ»²ãĿ¼£¬×¢Òâcd Óë..Ö®¼äÓпոñ¡£cd¡¡/·µ»Øµ½¸ùĿ¼¡£ cat ÎļþÃû ²é¿´ÎļþÄÚÈÝ cat >abc.txt Íùabc.txtÎļþÖÐдÉÏÄÚÈÝ¡£ more Î ......
Ê×Ïȼòµ¥µÄ½éÉÜÁ½Õߣº
¡¾linux²Ù×÷ϵͳ£º¼ò³ÆÃüÁ²Ù×÷ϵͳ¡¿
¼ò½é£º
¼òµ¥µØ˵£¬LinuxÊÇÒ»Ì×Ãâ·ÑʹÓúÍ×ÔÓÉ´«²¥µÄÀàUnix²Ù×÷ϵͳ£¬ËüÖ÷ÒªÓÃÓÚ»ùÓÚx86ϵÁÐCPUµÄ¼ÆËã»úÉÏ¡£Õâ¸öϵͳÊÇÓÉÊÀ½ç¸÷µØµÄ³ÉǧÉÏÍòµÄ³ÌÐòÔ±Éè¼ÆºÍʵÏֵġ£ÆäÄ¿µÄÊǽ¨Á¢²»ÊÜÈκÎÉÌÆ·»¯Èí¼þµÄ°æȨÖÆÔ¼µÄ¡¢È«ÊÀ½ç¶¼ÄÜ×ÔÓÉʹÓõÄUnix¼æÈݲúÆ·¡£
Ìص㣺 ......
------------------------------------------
±¾ÎÄϵ±¾Õ¾Ô´´,»¶ÓתÔØ!
תÔØÇë×¢Ã÷³ö´¦:http://ericxiao.cublog.cn/
------------------------------------------
Ò»£ºÇ°ÑÔ
ÔÚ¼üÅÌÇý¶¯´úÂë·ÖÎöµÄ±Ê¼ÇÖУ¬½Ó´¥µ½ÁËinput×Óϵͳ.¼üÅÌÇý¶¯£¬¼üÅÌÇý¶¯½«¼ì²âµ½µÄËùÓа´¼ü¶¼Éϱ¨¸øÁËinput×Óϵ ......
; break;
}
if (type != EV_SYN)
&nbs ......