|
|
@@ -21,6 +21,7 @@ impl Process {
|
|
21
|
21
|
}
|
|
22
|
22
|
}
|
|
23
|
23
|
|
|
|
24
|
+ /// Erstellt eine Prozess-Datenstruktur aus procinfo::Stat.
|
|
24
|
25
|
pub fn me() -> Self {
|
|
25
|
26
|
if let Ok(my_pid) = pid::stat_self() {
|
|
26
|
27
|
Process::new(my_pid.pid)
|
|
|
@@ -67,9 +68,8 @@ impl Process {
|
|
67
|
68
|
}
|
|
68
|
69
|
}
|
|
69
|
70
|
|
|
70
|
|
-/// Erstellt einen 'Process' aus der übergebenen PID und gibt die Prozesskette
|
|
|
71
|
+/// Geht von eigenem Prozess aus und gibt die Prozesskette bis zum übergebenem PID aus
|
|
71
|
72
|
/// und fängt mögliche Fehler ab.
|
|
72
|
|
-///
|
|
73
|
73
|
pub fn print(pid:pid_t) -> bool {
|
|
74
|
74
|
|
|
75
|
75
|
if let Err(_) = pid::stat(pid) {
|
|
|
@@ -77,7 +77,6 @@ pub fn print(pid:pid_t) -> bool {
|
|
77
|
77
|
return false
|
|
78
|
78
|
}
|
|
79
|
79
|
|
|
80
|
|
-
|
|
81
|
80
|
let my_proc = Process::me();
|
|
82
|
81
|
|
|
83
|
82
|
if !my_proc.has_parent_with_pid(pid) {
|