浏览代码

Updated readproc.rs. Not complete yet

Lorenz Bung 8 年前
父节点
当前提交
37744d4484
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      hw4/task1/src/readproc.rs

+ 3
- 3
hw4/task1/src/readproc.rs 查看文件

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
     match loadavg() {
19
     match loadavg() {
20
         Ok(stat) => {
20
         Ok(stat) => {
21
             let last_pid = stat.last_created_pid;
21
             let last_pid = stat.last_created_pid;
24
                 Err(_) => { Err("No last command via PID found") }
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
 pub fn get_thread_count(pid: i32) -> Result<u32, &'static str> {
31
 pub fn get_thread_count(pid: i32) -> Result<u32, &'static str> {
32
     match pid::stat(pid) {
32
     match pid::stat(pid) {

正在加载...
取消
保存