linuxĿ¼²Ù×÷º¯Êý£ÛתUC£Ý
ת×Ô£º
http://blog.chinaunix.net/u2/63316/showart_547992.html
LinuxϵÄĿ¼ÊÇÒÀÕÕ±ê×¼À´Êµ×÷µÄ£¬Òò´Ë£¬Äú¿ÉÒÔºÁÎÞÎÊÌâµØÒÆÖ³µ½ÈκÎÆäËüUNIXƽ̨¡£
--------------------------------------------------------------------------------
getcwd/getwd : È¡µÃÄ¿Ç°ËùÔÚĿ¼
--------------------------------------------------------------------------------
#include
char * getcwd(char *buf,size_t size);
buf½«»á·µ»ØĿǰ·¾¶Ãû³Æ¡£
ÈκεĴíÎó·¢Éú£¬½«»á·µ»ØNULL¡£Èç¹û·¾¶³¤¶È³¬¹ýsize£¬errnoΪERANGE¡£getcwd·µ»ØµÄÖµÓÀÔ¶ÊÇûÓÐsymbol linkµÄ¡£
--------------------------------------------------------------------------------
#include
char *getwd(char *buf);
getwdÊǸöΣÏյĺ¯Êý£¬Ò»°ã¶¼»áÇ¿ÁÒ½¨Òé²»ÒªÓã¬ÒòΪÄúÎÞ·¨È·¶¨×µÄĿ¼³¤¶ÈΪ¶àÉÙ¡£PATH_MAX¶¨ÒåÁË×µÄ·¾¶³¤¶È¡£ÔÚLinuxÏÂËùÒÔÌṩÕâ¸öº¯ÊýÖ÷ÒªÊÇÒòΪ¡¸´«Í³¡¹¡£
--------------------------------------------------------------------------------
//»ñȡϵͳĿ¼×î´ó³¤¶È
long pathconf(char* path, int flag);
--------------------------------------------------------------------------------
chdir/fchdir/chroot : ¸Ä±äÄ¿Ç°ËùÔÚĿ¼
--------------------------------------------------------------------------------
#include
int chdir(const char * pathname);
int fchdir(int fd);
chdir¸ù¾Ýpathname±ä¸üÄ¿Ç°µÄËùÔÚĿ¼£¬ËüÖ»¸Ä±ä¸Ã³ÌʽµÄËùÔÚĿ¼¡£
fchdir¸ù¾ÝÒÑ¿ªÆôµÄfd(file descriptor)Ŀ¼À´±ä¸ü¡£
//sample
/*¸ü¸Äµ±Ç°¹¤×÷Ŀ¼µ½Éϼ¶Ä¿Â¼*/
if(chdir("..")==-1){
perror("Couldn't change current working directory.\n");
return 1;
}
--------------------------------------------------------------------------------
#include
int chroot(const char * path);
chroot¸Ä
Ïà¹ØÎĵµ£º
Red-black Trees (rbtree) in Linux
January 18, 2007
Rob Landley <rob@landley.net>
=============================
red-blackÊ÷ÊÇʲôÑùµÄÊ÷£¬ÎªÊ²Ã´ÐèÒªred-blackÊ÷£¿
------------------------------------------------
red-black tree£¨RBÊ÷£©ÊÇÒ»ÖÖƽºâ¶þ²æÊ÷£¬ËüÖ÷ÒªÓÃÓÚ´æ´¢»òÕß˵ ......
¹¦ÄÜÃèÊö£º
»ñÈ¡»òÕßÉèÖÃ
Óëij¸öÌ×½Ó×Ö¹ØÁªµÄÑ¡ ÏѡÏî¿ÉÄÜ´æÔÚÓÚ¶à²ãÐÒé
ÖУ¬ËüÃÇ×Ü»á³öÏÖÔÚ×îÉÏÃæµÄÌ×½Ó×ֲ㡣µ±²Ù×÷Ì×½Ó×ÖÑ¡Ïîʱ£¬Ñ¡ÏîλÓڵIJãºÍÑ¡ÏîµÄÃû³Æ±ØÐë¸ø³ö¡£ÎªÁ˲Ù×÷Ì×½Ó×Ö²ãµÄÑ¡ÏӦ¸Ã ½«²ãµÄÖµÖ¸¶¨ÎªSOL_SOCKET¡£ÎªÁ˲Ù×÷ÆäËü²ãµÄÑ¡Ï¿ØÖÆÑ¡ÏîµÄºÏÊÊÐ ......
ÏîÄ¿Öг£Óöµ½ÐèÒª¶ÔÄ¿Ç°ÔËÐеÄϵͳ½øÐÐЧÂÊ·ÖÎö£¬»òÅöµ½¿Í»§×ÉѯÈçºÎÓÅ»¯ÏµÍ³µÄЧÂÊÎÊÌâ¡£¸ü¶àµÄÇé¿öÊÇ£¬ÔÚϵͳ³öÏÖÎÊÌâµÄʱºò£¬ÐèÒª·ÖÎöÔÒò£¬¶¨Î»ÏµÍ³ ¹ÊÕÏ»òÆ¿¾±£¬µ±È»£¬×îºÃÊÇ¿ÉÒÔÒ»²¢½â¾ö¹ÊÕÏ¡£µ«Êµ¼ÊÉÏ£¬²Ù×÷ϵͳÓÅ»¯ÊÇÒ»¸ö·Ç³£¸´ÔÓµÄÎÊÌ⣬¿öÇÒlinuxÓÐ×Ô¼ºÒ»Ì×ÓбðÓÚÆäËû²Ù×÷ϵͳ¹ÜÀíµÄ»úÖÆ£¬ÓÉ´Ë »áÒýÆðºÜ¶à²»±ØÒ ......
ÔÚ±¾ÎÄÖУ¬ËùνLinux֮·ÊÇָͨÏòÍêÃÀLinux×ÀÃæµÄµÀ·¡£Ì¸ÆðLinux×ÀÃ棬ÓÐÈ˲»Ð¼Ò»¹Ë£¬àÍÖ®ÒԱǡ£Êµ¼ÊÇé¿öÈçºÎ£¿
11ÔÂ29ÈÕ£¬Mint 8£¨Ò»ÖֱȽÏÍêÃÀµÄLinux×ÀÃ棩Õýʽ·¢²¼£¬ÔÚÎÒÃǹúÄÚ·´Ïì²»´ó¡£ÎÒ¹úLinux·¢Õ¹Ö®ÂäÎ飬ÎÒ¹úLinux¹ÛÄîÖ®¹ÖÒ죬Óɴ˿ɼûÒ»°ß¡£11ÔÂ18ÈÕ£¬ÔÚ¡¶Ubuntu³ô³æ£¨bugs£©Öª¶àÉÙ£¿¡·Ò»ÎÄÖУ¬Ìá¼°ÔÚUbuntu 9 ......
1.¿â¸ÅÊö
¿â¿ÉÒÔ·ÖΪ¾²Ì¬¿âºÍ¶¯Ì¬¿â£¬¾²Ì¬¿â±àÒëʱ±ØÐë´æÔÚ£¬³ÌÐòÔËÐÐʱ²»ÐèÒª¡£
¶¯Ì¬¿âÒ²³Æ¹²Ïí¿â£¬Æä´úÂë²»»áÁ´½Óµ½Ä¿±êÎļþÖ®ÖУ¬Ö»Ó屶¯Ì¬¿â¿É·ÃÎÊʱ£¬Ó¦ÓóÌÐò²ÅÄÜÕýÈ·µØÖ´Ðж¯Ì¬¿âº¯Êý¡£Ö´Ðж¯Ì¬¿âÓÐÁ½ÖÖ·½Ê½£ºÒþʽµ÷ÓúÍÏÔʾµ÷Óá£Òþʽµ÷ÓÃÒ²³Æ¹²Ïí¿âµÄ¾²Ì¬¼ÓÔØ£¬¶¯Ì¬¿âº¯ÊýÔÚÓ¦ÓóÌÐò¿ªÊ¼Ö´ÐÐʱ»á×Ô¶¯ÔØÈëÄڴ棬 ......