在内核代码的某些部分使用它之前,我想使用内核链表。但是,如果我只包含 list.h
,由于依赖关系,它不会工作。
如何在 single.c
文件中使用列表编写代码,例如test.c 以便我可以通过编译 test.c
来测试我的代码?期待很快收到您的来信。
另外,如何使用嵌套链表?
最佳答案
您可以从 http://www.mcs.anl.gov/~kazutomo/list/list.h 获取用户空间端口.
它说:
Here is a recipe to cook list.h for user space program
- copy list.h from linux/include/list.h
- remove
- #ifdef KERNE and its #endif
- all #include line
- prefetch() and rcu related functions
- add macro offsetof() and container_of
关于linux - 我可以在内核代码之外使用 Linux 内核链表吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13620501/