eminence / procfs

Rust library for reading the Linux procfs filesystem
Other
362 stars 106 forks source link

PID should be u32 #245

Closed tatref closed 1 year ago

tatref commented 1 year ago

Hi,

PID is currently i32:

https://github.com/eminence/procfs/blob/3d5c9fa43b4e9f4401de4de71328401efe9ecd1a/src/process/mod.rs#L957

However, in stdlib, PID is u32: https://doc.rust-lang.org/std/process/fn.id.html

Is there any reason for this?

eminence commented 1 year ago

I think it's because there are a few procfs fields that can return -1 (if the pid isn't available or something). I can't name these fields off the top of my head, but it would be good to find them and document them.

eminence commented 1 year ago

Based on the notes in #250, we're keeping pid as i32