Linuxϵͳµ÷Óà sigactionº¯ÊýÏê½â(Ò»)
¹¦ÄÜÃèÊö£º
´¦ÀíÐźš£¼È¿ÉÓÃÓÚÉ趨¶ÔÈÎÒâÐźŵĴ¦Àí·½Ê½£¬Ò²¿ÉÓÃÓÚ¼ìÑé¸ÃÐźŵÄÄ¿Ç°Ô¤Éè´¦Ö÷½Ê½¡£
Ó÷¨£º
#include <signal.h>
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
²ÎÊý£º
signum£º³ýÁËSIGKILLºÍSIGSTOPÖ®ÍâµÄÆäËüÈκÎÐźűàÂë¡£
act£ºÈç¹ûÖµ·ÇNULL£¬½«°²×°Îªsignum¹ØÁªÐźŵÄд¦Àí·½Ê½¡£
oldact£ºÈç¹ûÖµ·ÇNULL£¬´æ´¢ÒÔÇ°¶Ôsignum¹ØÁªÐźŵĴ¦Àí·½Ê½¡£
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);
}
ÔÚһЩÌåϵÉÏ£¬sa_handlerºÍsa_sigaction¹²ÓÃÒ»¸öÁªºÏÌå(union)£¬ËùÒÔ²»ÒªÍ¬Ê±Ö¸¶¨Á½¸ö×ֶεÄÖµ¡£
sa_restorer×Ö¶ÎÒÑÌÔÌ£¬²»Ó¦¸ÃÔÙ±»Ê¹Óá£
sa_handler×Ö¶ÎÖ¸¶¨ÓësignumÐźŹØÁªµÄÐÐΪ£¬¿ÉÄÜÊÇSIG_DFLĬÈÏÐÐΪ£¬SIG_IGNºöÂÔ½ÓË͵½µÄÐźţ¬»òÕßÒ»¸öÐźŴ¦Àíº¯ÊýÖ¸Õë¡£Õâ¸öº¯ÊýÒÔÒ»¸öÐźűàÂë×÷ΪËüµÄΨһ²ÎÊý¡£
Èç¹ûsa_flagsÖдæÔÚSA_SIGINFO±êÖ¾£¬ÄÇôsa_sigaction½«×÷ΪsignumÐźŵĴ¦Àíº¯Êý¡£Õâ¸öº¯ÊýµÄµÚÒ»²ÎÊýÊÇÐźűàÂ룬µÚ¶þ²ÎÊýÊÇsiginfo_t½á¹¹µÄÖ¸Õ룬µÚÈý²ÎÊýÊÇucontext_t½á¹¹Ö¸Õë(ÔìÐÍΪvoid *)¡£
sa_maskÖ¸¶¨ÐźŴ¦Àíº¯ÊýÖ´ÐеĹý³ÌÖÐÓ¦±»×èÈûµÄÐźš£ÁíÍ⣬³ýÁËSA_NODEFER±êÖ¾±»Ö¸¶¨Í⣬´¥·¢ÐźŴ¦Àíº¯ÊýÖ´ÐеÄÄǸöÐźÅÒ²»á±»×èÈû¡£
sa_flagsÖ¸¶¨Ò»ÏµÁÐÓÃÓÚÐÞ¸ÄÐźŴ¦Àí¹ý³ÌÐÐΪµÄ±êÖ¾£¬ÓÉÏÂÃæµÄ0¸ö»ò¶à¸ö±ê־ͨ¹ýorÔËËã×éºÏ¶ø³É£º
SA_NOCLDSTOP //´Ë±ê־Ϊonʱ£¬¼ÙÈçsignumµÄÖµÊÇSIGCHLD£¬ÔòÔÚ×Ó½ø³ÌÍ£Ö¹»ò»Ö¸´Ö´ÐÐʱ²»»á´«ÐźŸøµ÷Óñ¾ÏµÍ³µ÷ÓõĽø³Ì¡£
SA_NOCLDWAIT //´Ë±ê־Ϊonʱ£¬µ±µ÷ÓôËϵͳµ÷ÓõĽø³ÌÖ®×Ó½ø³ÌÖÕֹʱ£¬ÏµÍ³²»»á½¨Á¢zombie½ø³Ì¡£
SA_RESETHAND //´Ë±ê־Ϊonʱ£¬ÐźŴ¦Àíº¯Êý½ÓÊÕµ½Ðźź󣬻áÏȽ«¶ÔÐźŴ¦ÀíµÄ·½Ê½ÉèΪԤÉ跽ʽ£¬¶øÇÒµ±º¯Êý´¦Àí¸ÃÐźÅʱ£¬ºóÀ´·¢ÉúµÄÐźŽ«²»»á±»×èÈû¡£
SA_ONSTACK //Èç¹ûÀûÓÃsigaltstack()½¨Á¢ÐźÅרÓöÑÕ»£¬Ôò´Ë±êÖ¾»á°ÑËùÓÐÐźÅËÍÍù¸Ã¶ÑÕ»¡£
SA_RESTART //´Ë±ê־Ϊonʱ£¬ºËÐÄ»á×Ô¶¯ÖØÆôÐźÅÖжϵÄϵͳµ÷Ó
Ïà¹ØÎĵµ£º
VNC£¬È«³ÆΪVirtual Network Computing£¬ËüÊÇÒ»¸ö×ÀÃæ¹²Ïíϵͳ¡£ËüµÄ¹¦ÄÜ£¬ÀàËÆÓÚwindowsÖеÄÔ¶³Ì×ÀÃ湦ÄÜ¡£VNCʹÓÃÁËRFB(Remote FrameBuffer£¬Ô¶³ÌÖ¡»º³å£©ÐÒéÀ´ÊµÏÖÔ¶³Ì¿ØÖÆÁíÍâһ̨¼ÆËã»ú¡£Ëü°Ñ¼üÅÌ¡¢Êó±ê¶¯×÷·¢Ë͵½Ô¶³Ì¼ÆËã»ú£¬²¢°ÑÔ¶³Ì¼ÆËã»úµÄÆÁÄ»·¢»Øµ½±¾µØ¡£
VNC¼¼ÊõÓëƽ̨Î޹أ¬VNC Viewer¿ÉÒÔºÍVNC ServerÔÚ²»Í ......
ÎÒÃǽâÊÍFilesystem Hierarchy Standard(FHS)Ëù¶¨ÒåµÄ×éÖ¯½á¹¹¡£ Êý¾ÝÀàÐÍ ÎļþϵͳÊÇÓÃÀ´±£´æÊý¾ÝµÄ£¬²»Í¬ÀàÐ͵ÄÊý¾ÝÓ¦¸Ã·ÅÔÚÎļþϵͳÉϵIJ»Í¬Î»Öá£Òò´Ë£¬µÚÒ»²½±ØÐëÏÈÀíÇåÈçºÎ·ÖÀàÊý¾Ý¡£FHS½«Êý¾ÝµÄÊôÐÔ·ÖΪÁ½À࣬¸÷ÀàÊôÐÔ¸÷ÓÐÁ½ÖÖ½ØÈ»Ïà·´µÄÐÔÖÊ¡£ ¹²ÏíÐÔ£¨Êý¾ÝÓÃÓÚÍøÂç»·¾³ÖеÄÓ¦Ó÷¶Î§£© 1.¹²Ïí£º¿É¹©ÍøÂçÉϵĶภ......
ÔÚlinuxÄں˵ÄÔ´´úÂëÖУ¬ÒÔ»ã±àÓïÑÔ±àдµÄ³ÌÐò»ò³ÌÐò¶Î£¬ÓÐÁ½ÖÖ²»Í¬µÄÐÎʽ¡£
µÚÒ»ÖÖÊÂÍêÈ«µÄ»ã±à´úÂ룬ÕâÑùµÄ´úÂë²ÉÓÃ.s×÷ΪÎļþµÄºó׺¡£ÊÂʵÉÏ£¬¾¡¹ÜÊÇÍêÈ«µÄ»ã±à´úÂ룬ÏÖ´úµÄ»ã±à¹¤¾ßÒ²ÎüÊÕÁËCÓïÑԵij¤´¦£¬Ò²ÔÚ»ã±à֮ǰ¼ÓÉÏÁËÒ»ÌËÔ¤´¦Àí£¬¶øÔ¤´¦Àí֮ǰµÄÎļþÔòÒÔ.sΪºó׺¡£´ËÀࣨ.s£©ÎļþÒ²ºÍC³ÌÐòÒ»Ñù£¬¿ÉÒÔʹÓÃ#includ ......
ÊØ»¤½ø³ÌÒ²³ÆΪ¾«Áé½ø³Ì£¬ÊÇÒ»ÖÖÔËÐÐÔÚºǫ́µÄÌØÊâ½ø³Ì£¬Ëü²»´æÔÚ¿ØÖÆÖնˣ¬²¢ÖÜÆÚÐÔµØÖ´ÐÐijÏîÈÎÎñ»òµÈ´ý´¦ÀíijÏîÈÎÎñ¡£
ÊØ»¤½ø³ÌÌص㣺
l ËùÓеÄÊØ»¤½ø³Ì¶¼ÊÇÒÔ³¬¼¶Óû§Æô¶¯µÄ(UIDΪ0)£»
l ûÓпØÖÆÖÕ¶Ë(TTYΪ£¿)£»
l Öն˽ø³Ì×éIDΪ-1(TPGID±íʾÖն˽ø³Ì×éID£¬¸ÃÖµ±íʾÓë¿ØÖÆÖÕ¶ËÏà¹ØµÄǰ̨½ø³Ì×é£ ......
tar ÎļþÓëĿ¼ѹËõÃüÁî
tar [-cxtzjvfpPN] ÎļþÓëĿ¼ ....
²ÎÊý£º
-c £º½¨Á¢Ò»¸öѹËõÎļþµÄ²ÎÊýÖ¸Áî(create µÄÒâ˼)£»
-x £º½â¿ªÒ»¸öѹËõÎļþµÄ²ÎÊýÖ¸Á
-t £º²é¿´ tarfile ÀïÃæµÄÎļþ£¡
Ìرð×¢Ò⣬ÔÚ²ÎÊýµÄÏ´ïÖУ¬ c/x/t ½öÄÜ´æÔÚÒ»¸ö£¡²»¿Éͬʱ´æÔÚ£¡ÒòΪ²»¿ÉÄÜͬʱѹËõÓë½âѹËõ¡£
-z £ºÊÇ·ñͬʱ¾ßÓÐ gzip µÄ ......