Pin*_*ade 3 multithreading linux-kernel
我编写了一个用户可以读取或写入proc文件的模块 - 如何确定在内核级编程中读取或写入的用户进程中的线程数?
使用current作为一个指向当前的任务(目前task_struct你的读/写功能里面):
#include <linux/sched.h>
struct task_struct * t;
for (t = next_thread(current); t != current; t = next_thread(t)) {
// do the stuff
}
Run Code Online (Sandbox Code Playgroud)