Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个模块,用户可以在其中读取或写入 proc 文件 - 如何确定在内核级编程中读取或写入的用户进程中的线程数?
在读/写函数current中用作指向当前任务 (current ) 的指针:task_struct
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 }