linux»·¾³±àÒëc++¶¯Ì¬¿âÒÔ¼°µ÷Ó÷½Ê½
ÉÏÒ»´ÎÓÃlinuxÊÇ2002ÄêÓÃkdevelop¼°qt¿â¿ª·¢¶àýÌåÈí¼þ¡£
ʱ¸ô8ÄêÔÙÒ»´ÎÔÚlinuxϸ㿪·¢£¬ÒÀÈ»²ËÄñ£¬»¹ÊÇÉúÊè¡£
¸Ð¾õ×Ô¼ºµÄ´óÄԵĴ洢¿Õ¼ä£¬Ëæ×ÅÄêÁäµÄÔö¼ÓÔÚ±äС£¬ºÜ¶àŪ¹ýµÄ£¬ÓÖÖ»ÄÜ´ÓͷѧÆð¡£
²»¹ýÓо仰“»îµ½ÀÏ£¬Ñ§µ½ÀÏ”¹þ£¡
²ÑÀ¢£¬²ÑÀ¢¡£
1¡¢±àд¶¯Ì¬¿âµÄc++Îļþ
cvpnlib.cpp cvpnlib.h
2¡¢±àÒë³É¶¯Ì¬¿â
g++ -c -fPIC cvpnlib.cpp
g++ -shared -fPIC -o libvpnlib.so cvpnlib.o
3¡¢±àдµ÷ÓõĶ¯Ì¬¿âµÄ¿ØÖÆ̨³ÌÐòÎļþ
main.cpp
4¡¢±àÒë¿ØÖÆ̨³ÌÐò
g++ -c main.cpp
g++ -o main main.o -L. -lvpnlib
5¡¢¿½±´libvpnlib.soÎļþµ½/usr/libĿ¼ÏÂ
6¡¢ÔËÐÐ./main
Ïà¹ØÎĵµ£º
LinuxÄں˵÷ÊÔ
1 printk
[1] ʹÓ÷¶Î§
³ýÔÚϵͳÆô¶¯¹ý³ÌÖÐ,ÖÕ¶Ëδ³õʼ»¯Ö®Ç°, ÆäËûÈκÎʱºò,Èκεط½¶¼¿ÉÒÔµ÷ÓÃËü.
[2] ¼Ç¼µÈ¼¶
KERN_EMERG, KERN_ALERT, KERN_CRIT, KERN_ERR, KERN_WARNING, KERN_NOTICE, KERN_INFO, KERN_DEBUG.
Èô²»Ö¸¶¨¼Ç¼µÈ¼¶,º¯Êý»áÑ ......
Linux»·¾³½ø³Ì¼äͨÐÅ£¨Î壩: ¹²ÏíÄڴ棨ÉÏ£©
ÎĵµÑ¡Ïî
´òÓ¡±¾Ò³
½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ
¼¶±ð£º ³õ¼¶
Ö£ÑåÐË (mlinux@163.com), ¹ú·À¿Æ´ó¹¥¶Á²©Ê¿Ñ§Î»
2003 Äê 5 ÔÂ 01 ÈÕ
¹²ÏíÄÚ´æ¿ÉÒÔ˵ÊÇ×îÓÐÓõĽø³Ì¼äͨÐÅ·½Ê½£¬Ò²ÊÇ×î¿ìµÄIPCÐÎʽ¡£Á½¸ö²»Í¬½ø³ÌA¡¢B¹²ÏíÄÚ´æµÄÒâ˼ÊÇ£¬Í¬Ò»¿éÎïÀíÄÚ´æ±»Ó³Éäµ½½ø³ÌA¡ ......
du -sh * ²é¿´µ±Ç°Ä¿Â¼ÏµÄÎļþ¼Ð´óС
du ÃüÁî
ÓÃ;
¸ÅÊö´ÅÅÌʹÓá£
Óï·¨
du [ -a | -s ] [ -k ] [ -m ] [ -g ][ -l ] [ -r ] [ -x ] [ -H | -L ][ File ... ]
ÃèÊö
duÃüÁîÏÔʾÓÃÓÚÎļþµÄ¿éµÄÊýÁ¿¡£Èç¹ûÖ¸¶¨µÄFile²ÎÊýʵ¼ÊÉÏÊÇÒ»¸öĿ¼£¬¾ÍÒª±¨¸æ¸ÃĿ¼ÄÚµÄËùÓÐÎļþ¡£Èç¹ûûÓÐÌṩ File²ÎÊý£¬duÃüÁîÊ¹Ó ......
ת×Ô:http://www.xxlinux.com/linux/article/development/kernel/20090112/14828.html
sysfs ÊÇ Linux ÄÚºË
ÖÐÉè¼Æ½ÏеÄÒ»ÖÖÐéÄâµÄ»ùÓÚÄÚ´æµÄÎļþϵͳ£¬ËüµÄ×÷ÓÃÓë proc ÓÐЩÀàËÆ£¬µ«³ýÁËÓë proc ÏàͬµÄ¾ßÓв鿴ºÍÉ趨ÄÚºË
²ÎÊý¹¦ÄÜÖ®Í⣬»¹ÓÐΪ Linux ͳһÉ豸ģÐÍ×÷Ϊ¹ÜÀíÖ®Óá£Ïà±ÈÓÚ proc Îļþϵͳ£¬Ê¹Óà sysfs µ¼³ ......
1. man ¶ÔÄãÊìϤ»ò²»ÊìϤµÄÃüÁîÌṩ°ïÖú½âÊÍ
eg:man ls ¾Í¿ÉÒԲ鿴lsÏà¹ØµÄÓ÷¨
×¢£º°´q¼ü»òÕßctrl+cÍ˳ö£¬ÔÚlinuxÏ¿ÉÒÔʹÓÃctrl+cÖÕÖ¹µ±Ç°³ÌÐòÔËÐС£
2. ls ²é¿´Ä¿Â¼»òÕßÎļþµÄÊô*£¬ÁоٳöÈÎһĿ¼ÏÂÃæµÄÎļþ
eg: ls /usr/man
ls -l
a.d±íʾĿ¼(directory)£¬Èç¹ûÊÇÒ»¸ö"-"±íʾÊÇÎļþ£¬Èç¹ûÊÇlÔò±íʾÊÇÒ»¸öÁ¬½ÓÎÄ ......