3

ユーザーが proc ファイルを読み書きできるモジュールを作成しました - カーネル レベルのプログラミングで読み書きしているユーザー プロセスのスレッド数を確認するにはどうすればよいですか?

4

1 に答える 1

6

読み取り/書き込み関数内currentで現在のタスク ( 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
}
于 2012-09-30T11:01:24.153 に答える