Skip to content

Commit

Permalink
Use PF_KTHREAD from libc
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 31, 2024
1 parent 2d6e1a5 commit 31b7bd6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/unix/linux/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ enum ProcIndex {
// More exist but we only use the listed ones. For more, take a look at `man proc`.
}

/* Not exposed yet. Defined at include/linux/sched.h */
const PF_KTHREAD: c_ulong = 0x00200000;

pub(crate) struct ProcessInner {
pub(crate) name: String,
pub(crate) cmd: Vec<String>,
Expand Down Expand Up @@ -461,7 +458,7 @@ fn retrieve_all_new_process_info(

p.name = name.into();
if c_ulong::from_str(parts[ProcIndex::Flags as usize])
.map(|flags| flags & PF_KTHREAD != 0)
.map(|flags| flags & libc::PF_KTHREAD as c_ulong != 0)
.unwrap_or(false)
{
p.thread_kind = Some(ThreadKind::Kernel);
Expand Down

0 comments on commit 31b7bd6

Please sign in to comment.