linuxÄÚºËÖеÄHlistÓëList_head½á¹¹
List_Head
²Ù×÷ϵͳÄں˾³£ÐèҪά»¤Êý¾Ý½á¹¹¡£ÄÚºËÓбê×¼µÄÑ»·Á´±í¡¢Ë«ÏòÁ´±íµÄʵÏÖ¡£ÔÚ<Linux/list.h>ÎļþÖж¨ÒåÁËÒ»¸ölist_headÀàÐͼòµ¥½á¹¹£º
struct list_head {
struct list_head *next, *prev;
};
ͨÓÃÁ´±íµÄ³£ÓÃÓÃ;Êǽ«Ä³Ò»¸öÊý¾Ý½á¹¹±¾Éí´®³ÉÁ´±í£¬»ò½«Ä³Ð©Á´±íÓëÒ»¸öÊý¾Ý½á¹¹ÁªÏµÆðÀ´£¬ÕâÁ½ÖÖÇé¿öʵÖÊÉ϶¼ÊÇÓɽṹlist_head×é³ÉÁ´±í£¬Ö»ÊÇlist_headËù“±³¸º”µÄ¸ºÔز»Ò»Ñù¡£ÏÂÃæ·Ö±ð¾ÙÀý˵Ã÷ÕâÁ½ÖÖÓÃ;¡£
ÒÔÏÂʾÀý˵Ã÷ÁËÈçºÎ½«Ä³Ò»¸öÊý¾Ý½á¹¹±¾Éí´®³ÉÁ´±í£¬²¢¶ÔÁ´±í½øÐвÙ×÷£¬Í¬Ê±»¹ËµÃ÷list_head½á¹¹µÄʵÏÖÓëʹÓá£
ʾÀý£º½«Ä³Ò»¸öÊý¾Ý½á¹¹±¾Éí´®³ÉÁ´±í¡£
£¨1£©¼ÓÈëlist_head½á¹¹³ÉÔ±¡£
¼ÙÉèÓÐÒ»¸öexample_struct½á¹¹ÐèÁ¬½Ó³ÉÁ´±í£¬Òò¶øÔÚÆä½á¹¹ÀïÃæ¼ÓÉÏlist_head³ÉÔ±£¬¾Í×é³ÉÁ˽ṹÁ´±í£¬ÈçÏ£º
struct example_struct {
struct list_head list;
int priority;
……//ÆäËû³ÉÔ±
};
ÔÚexample_struct½á¹¹ÖеÄlist³ÉÔ±£¬ÓÃÀ´½«example_struct½á¹¹´®³ÉÁ´±í¡£¿ÉÀí½âΪlist_head“±³¸º”µÄ¸ºÔØÊÇexample_struct½á¹¹¡£
£¨2£©´´½¨list_head½á¹¹¡£
ʹÓÃÇ°±ØÐëÉêÇëÁ´±íÍ·²¢Óà INIT_LIST_HEAD ºêÀ´³õʼ»¯Á´±íÍ·¡£¿ÉʹÓÃÁ½ÖÖ·½·¨¡£
·½·¨1£º
struct list_head example_list;
INIT_LIST_HEAD(&example_list);
·½·¨2£º
LIST_HEAD(example_list);
ÆäÖУ¬ÕâÁ½¸öºêÔÚinclude/Linux/list.hÖж¨ÒåÈçÏ£º
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
ºê¶¨ÒåINIT_LIST_HEAD³õʼ»¯ÁËÁ´±íÍ·£¬¼´ÏòÇ°¡¢ÏòºóµÄÖ¸Õ붼ָÏòÁ´±íÍ·¡£ÕâÑù£¬¾ÍÒѳõʼ»¯ÁËÒ»¸öexample_listµÄÁ´±íÍ·£¬ÒÔºó¾Í¿ÉÒÔÏòÁ´±íÖÐÔö¼ÓÁ´±íÔªËØÁË¡£
£¨3£©Á´±íÓëÓû§½á¹¹Á¬½Ó¡£
list_entryºê½«exmplelistÁ´±íÓëexmple_struct½á¹¹ÀàÐÍÁ¬½ÓÆðÀ´¡£
ÓÐÁ½ÏîÁ´±íµÄÁ´±íÍ·
List_entryºêµÄЧ¹û
º¬list_headµÄ¶¨Öƽṹ
next
prev
list_head½á¹¹
¿ÕÁ´±í
<linux/list. h>ÖеÄÁ´±í
ÏÂÃæÕâ¸ö´úÂëÐоÍÊÇ´ÓexamplelistÁ´±íÖеõ½½Úµã¶ÔÓ¦µÄexample_struct½á¹¹Ö¸Õ룬ÆäÖÐptrÊÇexampleli
Ïà¹ØÎĵµ£º
[¾«»ª] ÍêÈ«Óà GNU/Linux ¹¤×÷
http://www.chinaunix.net ×÷Õß:enfuzion ·¢±íÓÚ£º2005-12-08 16:05:56
¡¾·¢±íÆÀÂÛ¡¿¡¾²é¿´ÔÎÄ¡¿¡¾LinuxÌÖÂÛÇø¡¿¡¾¹Ø±Õ¡¿
ת×Ôhttp://www.chinaunix.net/jh/4/16102.html
ÍêÈ«Óà GNU/Linux ¹¤×÷
— ±÷Æú Windows µÍЧÂʵŤ×÷·½Ê½£¬·¢¾ò&n ......
STAT(¸ÃÐг̵Ä״̬)
D: ²»¿ÉÓÃÐźÅÖжϵÄ˯Ãß״̬
R: ÕýÔÚÖ´Ðлò´¦ÓÚÖ´ÐжÓÁÐÖÐ
S: ¿ÉÒÔÓÃÐźÅÖжϵÄ˯Ãß״̬
T: ÔÝÍ£Ö´ÐÐ
Z: ½©ËÀ״̬
££££££££££££££££££££££££££££££££££££
W: ûÓÐ×ã¹»µÄ¼ÇÒäÌå·ÖÒ³¿É·ÖÅä
<: ¸ßÓÅÏÈÐòµÄÐгÌ
N: µÍÓÅÏÈÐòµÄÐгÌ&nbs ......
ÔÚÏò´ó¼ÒÏêϸ½éÉÜLinux mysql֮ǰ£¬Ê×ÏÈÈôó¼ÒÁ˽âÏÂLinux mysql£¬È»ºóÈ«Ãæ½éÉÜLinux mysql£¬Ï£Íû¶Ô´ó¼ÒÓÐÓá£
1. Linux mysql°²×°£º
$ yum install mysql-server
2. Linux mysqlÐÞ¸ÄrootÃÜÂ룺
$ mysqladmin -u root password
your_new_passwd
3. Æô¶¯Linux mysql·þÎñ
$ /etc/init.d/mysqld start
4. Ìí¼ÓΪϵͳ· ......
ÔÚLinuxÏ¿´µçÊÓ
ʱ¼ä£º2009-12-09 13:37:00 À´Ô´£ºÍøÂç ×÷ÕߣºÐ¡Â¬
¡¡¡¡³¤ÆÚÒÔÀ´£¬ÔÚLinux²Ù×÷ϵͳÏÂʹÓõçÊÓ¿¨ÊÇÒ»¼þ±È½ÏÂé·³µÄÊ£¬ÕâÊÇÒòΪ¸÷¼ÒµçÊÓ¿¨Éú²ú³§É̶¼Ã»ÓÐÌṩ¹Ù·½µÄLinuxÇý¶¯£¬Ö»ÓÐWindowsϵÄWDMÇý¶¯¡£
¡¡¡¡LinuxϵĵçÊÓ¿¨Çý¶¯£¬Ò»Ö±ÓÉlinux.bytesex.orgµÄLinux°®ºÃÕ߸ºÔ𿪷¢¡£¸ÃÇý¶¯ÓÐÁ½ ......
ÖÆ×÷¿ÉÒƶ¯µÄlinuxϵͳ(Ubuntu)
1¡¢¹âÅÌÆô¶¯£¬°²×°¸´ÖƵ½Òƶ¯Ó²ÅÌ£¬½«grub°²×°µ½dev/sda¡£
2¡¢¸´ÖÆÍêºóÖØÆô£¬¹âÅÌÆô¶¯£¬°²×°Æô¶¯½çÃæÊäÈërescue£¬½øÈë¼±¾Èģʽ£¬Ñ¡Ôñ¹ÒÔØ·ÖÇøʱ£¬Ñ¡ÔñϵͳËùÔÚÓ²Å̺ͷÖÇø¡£
3¡¢ctrl-Alt-F2£¬´ò¿ªÐ´°¿Ú¡£
CODE:mount -tproc proc /target/proc
chroot /target
su
4¡¢nano /etc/mkini ......