【发布时间】:2021-07-31 04:20:16
【问题描述】:
在 linux/include/linux/list.h 我发现:
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_head within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
“获取此条目的结构”是什么意思,我可以看一个用法示例以更好地理解吗?
【问题讨论】:
-
定义了一个宏,它调用具有相同参数的函数。