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

¶ÑÕ»¡¢linux c³ÌÐò´æ´¢¿Õ¼ä²¼¾ÖµÄ×ܽá

Õ»Ö÷ÒªÓÃÀ´´æ·Å¾Ö²¿±äÁ¿, ´«µÝ²ÎÊý, ´æ·Åº¯ÊýµÄ·µ»ØµØÖ·.esp ʼÖÕÖ¸ÏòÕ»¶¥, Õ»ÖеÄÊý¾ÝÔ½¶à, espµÄֵԽС.
¶ÑÓÃÓÚ´æ·Å¶¯Ì¬·ÖÅäµÄ¶ÔÏó, µ±ÄãʹÓà malloc , new µÈ½øÐзÖÅäʱ,ËùµÃµ½µÄ¿Õ¼ä¾ÍÔÚ¶ÑÖÐ. ¶¯Ì¬·ÖÅäµÃµ½µÄÄڴ渽´øÓзÖÅäÐÅÏ¢, ËùÒÔÄãÄܹ» realloc ºÍ freeµ÷ËüÃÇ.
È«¾Ö£¬¾²Ì¬ºÍ³£Á¿ÊÇ·ÖÅäÔÚÊý¾ÝÇøÖеġ£Êý¾ÝÇø°üÀ¨bssºÍ³õʼ»¯Çø¡£
¶ÑÏò¸ßÄÚ´æµØÖ·Éú³¤
Õ»ÏòµÍÄÚ´æµØÖ·Éú³¤
¶ÑºÍÕ»ÏàÏò¶øÉú£¬¶ÑºÍÕ»Ö®¼äÓиöÁÙ½çµã£¬³ÆΪstkbrk
CODE:
½ø³ÌÔÚÄÚ´æÖеÄÓ°Ïñ.
      ÎÒÃǼÙÉèÏÖÔÚÓÐÒ»¸ö³ÌÐò, ËüµÄº¯Êýµ÷ÓÃ˳ÐòÈçÏÂ.
      main(...) ->; func_1(...) ->; func_2(...) ->; func_3(...)
      ¼´: Ö÷º¯Êýmainµ÷Óú¯Êýfunc_1; º¯Êýfunc_1µ÷Óú¯Êýfunc_2; º¯Êýfunc_2µ÷Óú¯Êýfunc_3
      µ±³ÌÐò±»²Ù×÷ϵͳµ÷ÈëÄÚ´æÔËÐÐ, ÆäÏà¶ÔÓ¦µÄ½ø³ÌÔÚÄÚ´æÖеÄÓ°ÏñÈçÏÂͼËùʾ.
        (ÄÚ´æ¸ßÖ·)
        +--------------------------------------+
        |             ......                   | ... Ê¡ÂÔÁËһЩÎÒÃDz»ÐèÒª¹ØÐĵÄÇø
        +--------------------------------------+
        | env strings (»·¾³±äÁ¿×Ö´®)          | \
        +--------------------------------------+ \
        | argv strings (ÃüÁîÐÐ×Ö´®)           |   \
        +--------------------------------------+    \
        | env pointers (»·¾³±äÁ¿Ö¸Õë)         |    SHELLµÄ»·¾³±äÁ¿ºÍÃüÁîÐвÎÊý±£


Ïà¹ØÎĵµ£º

ÔÚLinuxÏÂÈçºÎʹÓÃ×Ô¼ºµÄ¿âº¯Êý

Ò»

ʹÓÿâ±ØÒªÐÔ
  
Ìá¸ß´úÂëÖØÓÃÐÔ¡£
¶þ
 
¿âµÄÖÖÀࣺ
  
1
¾²Ì¬¿â
    
Ò»°ãÒÔ
*.a
ÃüÃû¡£
    
³ÌÐò±àÒëʱ±»¼ÓÔØ£¬´Ëºó£¬Ö»Òª³ÌÐò²»±»ÖØбàÒ룬¾²Ì¬¿â¾ÍûÓÐ×÷ÓÃÁË£¨¿ÉÒÔɾµô£©¡£
ÓÉ
ÓÚ¾²Ì¬¿âµÄ´úÂëÔÚ±àÒë¹ý³ÌÖÐÒѾ­±»ÔØÈ ......

linux³£ÓÃÃüÁîÖ®Óû§¹ÜÀíƪ

°Ñ×Ô¼º³£ÓõÄһЩlinuxÃüÁî¼Ç¼ÏÂÀ´
1. ²é¿´µ±Ç°Óû§ºÍ×é
less /etc/passwd
less /etc/group  »òÕß  groups ²é¿´×é
    ÓÐÈË˵ÓÃÉÏÃæÄÇÁ½¸öÃüÁîµÃµ½µÄ½á¹û²»ÍêÈ«£¬Ò»Ð©ÌØÊⷽʽ½¨Á¢µÄ¾Í¿´²»µ½ÁË£¬¿É¸ÄÓÃ
getent passwd
getent group 
2. ¸Ä±äÎļþµÄËùÓÐÕߺÍËùÊô×é
chown baoniu ......

LinuxϵͳÐÅÏ¢²é¿´ÃüÁî´óÈ«


×î½ü¿´ÁËһЩLinuxÃüÁîÐеÄÎÄÕ£¬ÔÚϵͳÐÅÏ¢²é¿´·½Ãæѧµ½²»ÉÙÃüÁî¡£ ÏëÆðÒÔǰд¹ýµÄһƪÆäʵLinuxÕâÑùÓøü¼òµ¥
£¬
·¢ÏÖÕâЩϵͳÐÅÏ¢²é¿´ÃüÁîÒ²¿ÉÒÔ×ܽá³öһƪССµÄ¶«Î÷À´ÁË¡£
ÁíÍâÕâÀï
»¹Óзdz£¶àµÄÃüÁ ¿ÉÒÔ×÷Ϊ²Î¿¼¡£
ϵͳ
# uname -a # ²é¿´ÄÚºË/²Ù×÷ϵͳ/CPUÐÅÏ¢
# head -n 1 /etc/issue ......

Linux³£ÓÃÅäÖÃÎļþ


ÅäÖÃÎļþÒ»ÀÀ±í ÎļþλÖü°Ãû³Æ,×÷ÓÃ
¡¡¡¡/etc/rc.d/rc.sysinit
¡¡¡¡ÏµÍ³Æô¶¯Ê±µÄ¹«Ó÷þÎñÅäÖÃ
¡¡¡¡/etc/rc.d/rc.local
¡¡¡¡ÏµÍ³Æô¶¯Ê±µÄ±¾µØ·þÎñÅäÖÃ
¡¡¡¡/etc/bashrc¡¢/etc/profile
¡¡¡¡bash shellµÄ¹«ÓÃÅäÖÃ
¡¡¡¡/home/username/.bashrc
¡¡¡¡¸÷Óû§Ë½ÈËbash shellÅäÖÃ
¡¡¡¡/etc/securetty
¡¡¡¡Öն˰²È«ÉèÖà ......

¡ïÔõÑùѧϰCÓïÑÔ(Ï׸øÃÔãµÄC°®ºÃÕß)¡ï

Ò» £¬ÔõÑùѧϰCÓïÑÔ
     ºÜ¶àÈ˶ÔѧϰCÓïÑԸе½ÎÞ´ÓÏÂÊÖ£¬¾­³£ÎÊÎÒͬһ¸öÎÊÌ⣺¾¿¾¹ÔõÑùѧϰCÓïÑÔ£¿ÎÒÊÇÒ»¸ö½Ìʦ£¬ÒѾ­¿ª·¢Á˺ܶàÄêµÄ³ÌÐò£¬ºÍºÜ¶à¸Õ¸ÕÆð²½µÄÈËÒ»Ñù£¬Ñ§Ï°µÄµÚÒ»¸ö¼ÆËã»úÓïÑÔ¾ÍÊÇCÓïÑÔ¡£¾­¹ýÕâЩÄêµÄ¿ª·¢£¬ÎÒÉîÉîµÄÌå»áµ½CÓïÑÔ¶ÔÓÚÒ»¸ö³ÌÐòÉè¼ÆÈËÔ±¶àôµÄÖØÒª£¬Èç¹û²»¶®CÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ