Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÖÐfork()ÈçºÎʵÏÖ¸¸×Ó½ø³Ì²»Í¬µÄ·µ»ØÖµ

        ÍøÉϹØÓÚfork()ÎÄÕ¶¼Ëµfork()À´´´½¨×Ó½ø³Ì,ÀûÓ÷µ»ØÖµµÄ²»Í¬À´Ö´Ðв»Í¬µÄ´úÂð¶Î.µ«¶¼Ã»ÓÐ˵µ½ÈçºÎʵÏÖ²»Í¬µÄ·µ»ØÖµ.ÏÂÃæÎÒ½«ºÍÄãÀ´ËµËµÕâ¸öÎÊ題:
        ¿¼ÂÇÈçÏ´úÂë:
        int    i   =    fork();
        if ( i  )
        {
        ......
        }
        else
        {
        ........
        }
        .......
        µ±¸¸½ø³ÌÖ´Ðе½ÕâÒ»¾äʱ:int   i = fork(),¾Í´´½¨ÁËÒ»¸öеĽø³Ì,еĽø³ÌÓÐ×Ô¼ºµÄ¶ÑÕ»¶ÎºÍ´úÂë¶Î,µ«ÊǺ͸¸½ø³Ì¹²Ïí´úÂë¶Î.×îÐèÒªÖ÷ÒâµÄÊÇ,
×Ó½ø³ÌµÄÉÏÏÂÎÄÒ²ºÍ¸¸½ø³ÌÏàͬ,Õâ¾ÍÊÇ˵,´Ëʱ,¸¸½ø³ÌµÄ PCÖ¸Ïòint   i   =  fork(),×Ó½ø³ÌµÄ PCÒ²Ö¸Ïòint     i  =  fork().µ«ÊÇ,Ë­¶¼ÖªµÀ,µ±Ç°PCÖ¸ÏòµÄÕâ¸öÓï¾äÊǺ­Êýµ÷ÓÃ,¼´È»ÊǺ­Êýµ÷ÓÃ,¾ÍÓзµ»ØÖµ,·µ»ØÖµ·ÅÔÚÄÄÀïÄØ?¾ÍÊÇ·ÅÔÚ½ø³ÌµÄ¸÷×Ô¶ÑÕ»ÖÐ.ËùÒÔÔÚ¸¸½ø³Ìµ÷ÓÃfork()ʱ,fork()º­ÊýÔÚ¸¸½ø³ÌµÄ¶ÑÕ»ÖÐдÈë×Ó½ø³ÌµÄ½ø³ÌID,¶øÓÖÔÚ¸Õ¸Õ´´½¨µÄ×Ó½ø³ÌµÄ¶ÑÕ»ÖÐдÈë0.fork()º­Êýµ÷ÓýáÊøºó,ÒòΪÓÐеĽø³Ì,ËùÒÔϵͳҪÖØе÷¶È,¾ÍÔÚÕâÒ»¿Ì,¸¸×Ó½ø³ÌµÄPCÖ¸Ïòfork()º­Êý·µ»Ø´¦,Èç¹û¸¸½ø³ÌµÃµ½ÔËÐÐ,Ôò¸¸½ø³Ì´Ó×Ô¼ºµÄ¶ÑÕ»Öеõ½µÄ·µ»ØÖµÊÇ×Ó½ø³ÌµÄID,´Ó¶ø   i  =  ID;Èç¹û×Ó½ø³ÌµÃµ½ÔËÐÐ,Ôò×Ó½ø³Ì´Ó×Ô¼ºµÄ¶ÑÕ»Öеõ½µÄ·µ»ØÖµÊÇ0,¼´  i   =  0.
     
ÓÖ¿¼ÂÇÒÔÏ´úÂë:
      int    i  =  fork();
          .......
      int    j   = fork();
          


Ïà¹ØÎĵµ£º

Unix/Linux³£ÓÃÃüÁî—Ŀ¼µÄ´´½¨Óëɾ³ý

mkdirÃüÁî
¹¦ÄÜ£º´´½¨Ò»¸öĿ¼£¨ÀàËÆMSDOSϵÄmdÃüÁ¡£
Óï·¨£ºmkdir [Ñ¡Ïî] dir-name
˵Ã÷£º¸ÃÃüÁî´´½¨ÓÉdir-nameÃüÃûµÄĿ¼¡£ÒªÇó´´½¨Ä¿Â¼µÄÓû§ÔÚµ±Ç°Ä¿Â¼ÖУ¨dir-nameµÄ¸¸Ä¿Â¼ÖУ©¾ßÓÐдȨÏÞ£¬²¢ÇÒdirname²»ÄÜÊǵ±Ç°Ä¿Â¼ÖÐÒÑÓеÄĿ¼»ò ÎļþÃû³Æ¡£
ÃüÁîÖи÷Ñ¡ÏîµÄº¬ÒåΪ£º
- m ¶Ôн¨Ä¿Â¼ÉèÖôæȡȨÏÞ¡£Ò²¿ÉÒÔÓà ......

OUI 25031 linux°²×°oracle

/etc/hostsÒ»¶¨ÒªÓÐÑϸñµÄ¸ñʽ!!!
grid control 10.2.0.1.1°²×°×¢ÒâÊÂÏî
1.hostname
ÍøÂ磺
    ¾¡Á¿Ê¹Óþ²Ì¬IP£¬/etc/hostsµÄÎļþ¸ñʽºÜÖØÒª£¬²»ÖªµÀÊǸöBUG»¹ÊÇÒªÇó¾ÍÊÇÄÇôÑϸñ¡£ÎÒÒ»¿ªÊ¼¾ÍÊÇÔÚÕâ³ÔµÄ¿÷£¬ÔÚprecheckÐèÇóµÄʱºòºöÂÔÁË/etc/hosts¼ì²éʧ°ÜµÄ´íÎ󣬽á¹û°²×°Èí¼þûÎÊÌ⣬µ«ÅäÖõÄʱºò³ö´í ......

Linux select()Ïê½â

Linux select()Ïê½â selectϵͳµ÷ÓÃÊÇÓÃÀ´ÈÃÎÒÃǵijÌÐò¼àÊÓ¶à¸öÎļþ¾ä±ú(file descriptor)µÄ״̬±ä»¯µÄ¡£³ÌÐò»áÍ£ÔÚselectÕâÀïµÈ´ý£¬Ö±µ½±»¼àÊÓµÄÎļþ¾ä±úÓÐijһ¸ö»ò¶à¸ö·¢ÉúÁË״̬¸Ä±ä¡£ ÎļþÔÚ¾ä±úÔÚLinuxÀïºÜ¶à£¬Èç¹ûÄãmanij¸öº¯Êý£¬ÔÚº¯Êý·µ»ØÖµ²¿·Ö˵µ½³É¹¦ºóÓÐÒ»¸öÎļþ¾ä±ú±»´´½¨µÄ¶¼Êǵģ¬Èçman socket¿ÉÒÔ¿´µ½&ldqu ......

Linux ³õ½Ó´¥

1. װϵͳ
ÎÒ×°µÄ˫ϵͳ£¬Windows 7 ºÍ Fedora 12.
1£©ÎÒµÄCÅÌÓÐ50GB£¬ËùÒÔÎÒÏÈ·ÖÁËÇø£¬·Ö³É3¸ö£¬1¸ö30GB£¬1¸ö15GB£¬Ê£ÏµÄÒ»¸öÇø3GB¡£
2£©ÏÈ×°Windows 7ÔÚ30GBµÄ·ÖÇø¡£
     P£ºSonyµÄÐͺÅVGN-NR120EºÜ±ä̬£¬°²×°µÄʱºò±ØÐëÒªÓÃ×îв¹¶¡µÄ°²×°Å̲ſÉÒÔÇý¶¯µ½Ó²ÅÌ£¨µ¼Ö²»ÄÜ×°XP£©£¬¿ÉÄÜÊÇHDD ......

Linux¿ª»ú×Ô¶¯¹ÒÔØwindows¹²ÏíÎļþ¼Ð

±à¼­gedit /etc/fstab:
//192.168.1.1/winshare /mnt/share defaults,auto,username=windowsÓû§Ãû, password=windowsÃÜÂë 0 0
±¸×¢£º
£¨1£©ÖÕ¶ËÃüÁîÐйÒÔØ£ºmount //192.168.1.1/winshare /mnt/share -o user=windowsÓû§Ãû%windowsÃÜÂë
£¨2£©etc/rc.d/rcÔò¸ù¾ÝÆä²ÎÊýÖ¸¶¨µÄÔËÐÐģʽ(ÔËÐ춱ð£¬ÔÚinittabÎļþÖпÉÒÔÉèÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ