linux½ø³Ì¿ØÖÆ£exit£¨£©
http://blog.chinaunix.net/u1/53053/showart_425191.html
#include<stdlib.h>
void exit(int status);
²»ÏñforkÄÇôÄÑÀí½â£¬´ÓexitµÄÃû×Ö¾ÍÄÜ¿´³ö£¬Õâ¸öϵͳµ÷ÓÃÊÇÓÃÀ´ÖÕÖ¹Ò»¸ö½ø³ÌµÄ¡£ÎÞÂÛÔÚ³ÌÐòÖеÄʲôλÖã¬Ö»ÒªÖ´Ðе½exitϵͳµ÷Ó㬽ø³Ì¾Í»áֹͣʣϵÄËùÓвÙ×÷£¬Çå³ý°üÀ¨PCBÔÚÄڵĸ÷ÖÖÊý¾Ý½á¹¹£¬²¢ÖÕÖ¹±¾½ø³ÌµÄÔËÐС£Çë¿´ÏÂÃæµÄ³ÌÐò£º
/* exit_test1.c */
#include<stdlib.h>
main()
{
printf("this process will exit!\n");
exit(0);
printf("never be displayed!\n");
}
±àÒëºóÔËÐУº
$gcc exit_test1.c -o exit_test1
$./exit_test1
this process will exit!
ÎÒÃÇ¿ÉÒÔ¿´µ½£¬³ÌÐò²¢Ã»ÓдòÓ¡ºóÃæµÄ"never be displayed!\n"£¬ÒòΪÔÚ´Ë֮ǰ£¬ÔÚÖ´Ðе½exit(0)ʱ£¬½ø³Ì¾ÍÒѾÖÕÖ¹ÁË¡£
exit ϵͳµ÷ÓôøÓÐÒ»¸öÕûÊýÀàÐ͵IJÎÊýstatus£¬ÎÒÃÇ¿ÉÒÔÀûÓÃÕâ¸ö²ÎÊý´«µÝ½ø³Ì½áÊøʱµÄ״̬£¬±ÈÈç˵£¬¸Ã½ø³ÌÊÇÕý³£½áÊøµÄ£¬»¹ÊdzöÏÖijÖÖÒâÍâ¶ø½áÊøµÄ£¬Ò»°ãÀ´Ëµ£¬0±íʾûÓÐÒâÍâµÄÕý³£½áÊø£»ÆäËûµÄÊýÖµ±íʾ³öÏÖÁË´íÎ󣬽ø³Ì·ÇÕý³£½áÊø¡£ÎÒÃÇÔÚʵ¼Ê±à³Ìʱ£¬¿ÉÒÔÓÃwaitϵͳµ÷ÓýÓÊÕ×Ó½ø³ÌµÄ·µ»ØÖµ£¬´Ó¶øÕë¶Ô²»Í¬µÄÇé¿ö½øÐв»Í¬µÄ´¦Àí¡£¹ØÓÚwaitµÄÏêϸÇé¿ö£¬ÎÒÃǽ«ÔÚÒÔºóµÄƪ·ùÖнøÐнéÉÜ¡£
exitºÍ_exit
×÷Ϊϵͳµ÷ÓöøÑÔ£¬_exitºÍexitÊÇÒ»¶ÔÂÏÉúÐֵܡ£
ÕâʱËæ±ãÒ»¸ö¶®µÃCÓïÑÔ²¢ÇÒÍ·ÄÔÇåÐѵÄÈ˶¼»á˵£¬_exitºÍexitûÓÐÈκÎÇø±ð£¬µ«ÎÒÃÇ»¹Òª½²Ò»ÏÂÕâÁ½ÕßÖ®¼äµÄÇø±ð£¬ÕâÖÖÇø±ðÖ÷ÒªÌåÏÖÔÚËüÃÇÔÚº¯Êý¿âÖеĶ¨Òå¡£_exitÔÚLinuxº¯Êý¿âÖеÄÔÐÍÊÇ£º
#include<unistd.h>
void _exit(int status);
ºÍexit±È½Ïһϣ¬exit()º¯Êý¶¨ÒåÔÚ stdlib.hÖУ¬¶ø_exit()¶¨ÒåÔÚunistd.hÖУ¬´ÓÃû×ÖÉÏ¿´£¬stdlib.hËƺõ±Èunistd.h¸ß¼¶Ò»µã£¬ÄÇô£¬ËüÃÇÖ®¼äµ½µ×ÓÐʲôÇø±ðÄØ£¿ÈÃÎÒÃÇÏÈÀ´¿´Á÷³Ìͼ£¬Í¨¹ýÏÂͼ£¬ÎÒÃÇ»á¶ÔÕâÁ½¸öϵͳµ÷ÓõÄÖ´Ðйý³Ì²úÉúÒ»¸ö½ÏΪֱ¹ÛµÄÈÏʶ¡£
´ÓͼÖпÉÒÔ¿´³ö£¬_exit()º¯ÊýµÄ×÷ÓÃ×îΪ¼òµ¥£ºÖ±½Óʹ½ø³ÌÍ£Ö¹ÔËÐУ¬Çå³ýÆäʹÓõÄÄÚ´æ¿Õ¼ä£¬²¢Ïú»ÙÆäÔÚÄÚºËÖеĸ÷ÖÖÊý¾Ý½á¹¹£»exit()º¯ÊýÔòÔÚÕâЩ»ù´¡ÉÏ×÷ÁËһЩ°ü×°£¬ÔÚÖ´ÐÐÍ˳ö֮ǰ¼ÓÁËÈô¸ÉµÀ¹¤Ðò£¬Ò²ÊÇÒòΪÕâ¸öÔÒò£¬ÓÐЩÈËÈÏΪexitÒѾ²»ÄÜËãÊÇ´¿´âµÄϵͳµ÷Óá£
exit()º¯ÊýÓë_exit()º¯Êý×î´óµÄÇø±ð¾ÍÔÚÓÚexit()º¯ÊýÔÚµ÷ÓÃexitϵͳµ÷ÓÃ֮ǰҪ¼ì²éÎļþµÄ´ò¿ªÇé¿ö£¬°ÑÎļþ»º³åÇøÖеÄÄÚÈÝд»ØÎļþ£¬¾ÍÊÇͼÖеēÇåÀíI/O»º³å”Ò»Ïî¡£
ÔÚLinux µÄ±ê×¼º¯Êý¿âÖ
Ïà¹ØÎĵµ£º
½ø³Ìµ÷¶ÈÕþ²ß¾ÍÊǵ÷¶ÈϵͳÖÖÄÄÒ»¸ö½ø³ÌÀ´CPUÔËÐС£ÕâÖÖµ÷¶È·Ö2²ã¿¼ÂÇ¡£
µÚÒ»²ã£¬½ø³Ì״̬Õâ¸öÊÇ×îÓÅÏÈ¿¼Âǵģ¬Ò²¾ÍÊÇ˵ÓÅÏȼ¶×î¸ßµÄ¡£ÔÚlinuxÖÐÖ»ÓоÍÐ÷̬µÄ½ø³Ì²ÅÓпÉÄܻᱻµ÷¶ÈÑ¡ÖÐÈ»ºóÕ¼ÓÐCPU£¬ÆäËü״̬µÄ½ø³Ì²»¿ÉÄÜÕ¼Óеĵ½CPU¡£ÏÂÃæÊÇlinuxÖнø³ÌµÄ״̬
TASK_RUNNING:¾ÍÐ÷״̬£¬µÃµ½CPU¾Í¿ÉÒÔÔËÐС£
TASK_INTERRU ......
LinuxÍøÂçÇý¶¯³ÌÐò±àд(Ò»)
¹¤×÷ÐèҪдÁËÎÒÃǹ«Ë¾Ò»¿éÍø¿¨µÄLinuxÇý¶¯³ÌÐò¡£¾ÀúÒ»¸ö´ÓÎÞµ½ÓеĹý³Ì£¬Éî¸Ð¼¼Êõ½»Á÷µÄÖØÒª¡£Linux×÷ΪÌôս΢Èí¢¶ÏµÄÇ¿ÓÐÁ¦ÎäÆ÷£¬ÈÕÒæÊܵ½´ó¼ÒµÄϲ°®¡£ÕæÏ£ÍûËýÄÜÔÚÖйúѸËٳɳ¤¡£°Ñ³ÌÐòÎĵµÌù³öÀ´£¬Ï£ÍûºÍ´ó¼Ò̽ÌÖLinux¼¼ÊõºÍÓ¦Ó㬴ٽøLinuxÔÚÖйúµÄÆÕ¼°¡£
¡¡¡¡±¾ÎÄ¿ÉËæÒâתÔØ£¬µ«Çë²»ÒªÔ ......
¡¡Èý.±àдLinuxÍøÂçÇý¶¯³ÌÐòÖÐÐèҪעÒâµÄÎÊÌâ
¡¡¡¡3.1 ÖжϹ²Ïí
¡¡¡¡LinuxϵͳÔËÐм¸¸öÉ豸¹²Ïíͬһ¸öÖжϡ£ÐèÒª¹²ÏíµÄ»°£¬ÔÚÉêÇëµÄʱºòÖ¸Ã÷¹²Ïí·½Ê½¡£ÏµÍ³ÌṩµÄrequest_irq()µ÷ÓõĶ¨Ò壺
¡¡¡¡¡¡¡¡int request_irq(unsigned int irq,
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡void (*handler)(int irq, void *dev_id, struct pt_regs *re ......
1) SIGHUP
±¾ÐźÅÔÚÓû§ÖÕ¶ËÁ¬½Ó(Õý³£»ò·ÇÕý³£)½áÊøʱ·¢³ö, ͨ³£ÊÇÔÚÖն˵ĿØÖƽø³Ì½áÊøʱ, ֪ͨͬһsessionÄڵĸ÷¸ö×÷Òµ, ÕâʱËüÃÇÓë¿ØÖÆÖն˲»ÔÙ¹ØÁª¡£
µÇ¼Linuxʱ£¬ÏµÍ³»á·ÖÅä¸øµÇ¼Óû§Ò»¸öÖÕ¶Ë(Session)¡£ÔÚÕâ¸öÖÕ¶ËÔËÐеÄËùÓгÌÐò£¬°üÀ¨Ç°Ì¨½ø³Ì×éºÍºǫ́½ø³Ì×飬һ°ã¶¼ÊôÓÚÕâ
¸ö Sessio ......
ÎÒÏë¸üÓкܶàÈËûÓÐÌý˵¹ýZModemÐÒ飬¸ü²»ÖªµÀÓÐrz/szÕâÑù·½±ãµÄ¹¤¾ß¡£
¡¡¡¡ºÃ¶«Î÷²»¸Ò¶ÀÏí¡£ÒÔϸø³öÎÒÖªµÀµÄÒ»µãƤë¡£
¡¡¡¡ÏÂÃæÒ»¶ÎÊÇ´ÓSecureCRTµÄ°ïÖúÖÐcopyµÄ£º
¡¡¡¡ZModem is a full-duplex file transfer protocol that supports fast data transfer rates and effective error detection. ZModem is very user ......