bool eof;
FILE *f;
- if (pid == 0)
+ if (pid == 0 || pid == 1) /* pid 1, and we ourselves certainly aren't a kernel thread */
return 0;
- assert(pid > 0);
+ assert(pid > 1);
p = procfs_file_alloca(pid, "cmdline");
f = fopen(p, "re");
p = procfs_file_alloca(pid, "status");
- r = get_status_field(p, "\nCapEff:", capeff);
+ r = get_proc_field(p, "CapEff", WHITESPACE, capeff);
if (r == -ENOENT)
return -ESRCH;
return 0;
}
-#endif // 0
int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
int r;
return 0;
}
+#endif // 0
int wait_for_terminate(pid_t pid, siginfo_t *status) {
siginfo_t dummy;