*参照元 [#kfcf0887] #backlinks *説明 [#pe499d75] -パス: [[linux-2.6.25/include/linux/list.h]] -リストが空かどうかを判定する。 --Linux では先頭要素にはデータを入れず、先頭要素以降に 有効なデータを入れる戦略を採っている。 そのため先頭要素のみのリスト=空のリスト、として扱う。 **引数 [#jce3a358] -const struct list_head *head --リストを指定する。 --[[linux-2.6.25/list_head]] **返り値 [#j5e5f35f] -int --リストが空なら 0 以外、リストが空でなければ 0 を返す。 **参考 [#i7c316cd] *実装 [#p32ba1f2] /** * list_empty - tests whether a list is empty * @head: the list to test. */ static inline int list_empty(const struct list_head *head) { return head->next == head; -次要素が自分自身ならば要素は自分自身のみ(=空のリスト)である。 } *コメント [#p75f1181] #comment