pause();
}
+int get_process_threads(pid_t pid) {
+ _cleanup_free_ char *t = NULL;
+ const char *p;
+ int n, r;
+
+ if (pid < 0)
+ return -EINVAL;
+
+ p = procfs_file_alloca(pid, "status");
+
+ r = get_proc_field(p, "Threads", WHITESPACE, &t);
+ if (r == -ENOENT)
+ return proc_mounted() == 0 ? -ENOSYS : -ESRCH;
+ if (r < 0)
+ return r;
+
+ r = safe_atoi(t, &n);
+ if (r < 0)
+ return r;
+ if (n < 0)
+ return -EINVAL;
+
+ return n;
+}
+
static const char *const sigchld_code_table[] = {
[CLD_EXITED] = "exited",
[CLD_KILLED] = "killed",