|
|
@@ -15,7 +15,7 @@ pub fn get_pid_command(pid: i32) -> Result<String, &'static str> {
|
|
15
|
15
|
}
|
|
16
|
16
|
}
|
|
17
|
17
|
|
|
18
|
|
-/*pub fn get_last_created_command() -> Result<String, &'static str> {
|
|
|
18
|
+pub fn get_last_created_command() -> Result<String, &'static str> {
|
|
19
|
19
|
match loadavg() {
|
|
20
|
20
|
Ok(stat) => {
|
|
21
|
21
|
let last_pid = stat.last_created_pid;
|
|
|
@@ -24,9 +24,9 @@ pub fn get_pid_command(pid: i32) -> Result<String, &'static str> {
|
|
24
|
24
|
Err(_) => { Err("No last command via PID found") }
|
|
25
|
25
|
}
|
|
26
|
26
|
}
|
|
27
|
|
- Err(_) => { Err("No last command via PID found") }
|
|
|
27
|
+ Err(_) => { Err("No last command found") }
|
|
28
|
28
|
}
|
|
29
|
|
-}*/
|
|
|
29
|
+}
|
|
30
|
30
|
|
|
31
|
31
|
pub fn get_thread_count(pid: i32) -> Result<u32, &'static str> {
|
|
32
|
32
|
match pid::stat(pid) {
|