Do not try to open traceme on special PIDs

This commit is contained in:
Jeremy Soller
2021-12-01 09:52:31 -07:00
parent c51aec1af6
commit e90fa3e32f
+2
View File
@@ -52,6 +52,8 @@ pub fn init_state() -> &'static State {
}
}
pub fn is_traceme(pid: pid_t) -> bool {
// Skip special PIDs (<=0)
if pid <= 0 { return false; }
File::open(
&CString::new(format!("chan:ptrace-relibc/{}/traceme", pid)).unwrap(),
fcntl::O_PATH,