diff --git a/src/tools/procfs.rs b/src/tools/procfs.rs index 9187096d..9c81531a 100644 --- a/src/tools/procfs.rs +++ b/src/tools/procfs.rs @@ -13,7 +13,7 @@ pub struct ProcFsPidStat { pub rss: i64, } -pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result { +pub fn read_proc_pid_stat(pid: libc::pid_t) -> Result { let statstr = tools::file_read_firstline(format!("/proc/{}/stat", pid))?; @@ -22,7 +22,7 @@ pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result } if let Some(cap) = REGEX.captures(&statstr) { - if pid != nix::unistd::Pid::from_raw(cap["pid"].parse::().unwrap()) { + if pid != cap["pid"].parse::().unwrap() { bail!("unable to read pid stat for process '{}' - got wrong pid", pid); } @@ -40,7 +40,7 @@ pub fn read_proc_pid_stat(pid: nix::unistd::Pid) -> Result bail!("unable to read pid stat for process '{}'", pid); } -pub fn read_proc_starttime(pid: nix::unistd::Pid) -> Result { +pub fn read_proc_starttime(pid: libc::pid_t) -> Result { let info = read_proc_pid_stat(pid)?;