如何使用list.h
中定义的/include/linux/list.h
打印列表值?
答案 0 :(得分:2)
这样的事情:
struct list_head head; /* previously initialized */
struct list_head *pos;
list_for_each(pos, head)
{
your_type *elt;
elt = list_entry(pos, typeof(*elt), name_of_list_head_struct_member);
/* and print *elt! */
}