精選文章
- 取得連結
 - X
 - 以電子郵件傳送
 - 其他應用程式
 
new linux device driver - linked list
github
1. include <linux/list.h>
2. 資料結構
    struct pet
     帶 struct list_head list;
3. 靜態初始化
   static LIST_HEAD(petlist);
4. 個別 items 
   struct pet dog1, dog2;
     每個都要做 INIT_LIST_HEAD()
5. list add
    list_add() 加頭
    list_add_tail() 加尾
6. list_for_each_entry(每個 iterator, 總 list 位置, 資料結構內 list_head 名稱)
    e.g. list_for_each_entry(mpet, &petlist, list)
結果:
    my pet name: Snow
    my pet name: Dragon

留言
張貼留言