LoginSignup
3
3

More than 5 years have passed since last update.

カーネルスレッド判定

Posted at

systemdにはis_kthreadという、指定PIDのプロセスがカーネルスレッドかどうか判定する関数がある。その方法は/proc/PID/cmdlineの中身が空かどうかというもの。

昔、自分で同じ判定をするプログラムを書いたことがある。その時は/proc/PID/statを見て、プロセスグループIDとセッションIDがともに0ならばカーネルスレッドと判定していた。

なにかもっと直接的な方法はないのだろうか。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3