* fuser uses correct timeout_stat define Debian #661723
* fuser is not compiled on hurd-i386 Debian #673485
* No TEXTRELS in src/lists built as PIE on x86
+ * Fake pstree root for kernels with hidepid turned on
Changes in 22.16
================
ppid = 0;
if (isthread)
this->flags |= PFLAG_THREAD;
- if (!(parent = find_proc(ppid)))
+ if (!(parent = find_proc(ppid))) {
#ifdef WITH_SELINUX
parent = new_proc("?", ppid, 0, scontext);
#else /*WITH_SELINUX */
parent = new_proc("?", ppid, 0);
#endif /*WITH_SELINUX */
+ /* When using kernel 3.3 with hidepid feature enabled on /proc
+ * then we need fake root pid */
+ if (!isthread && pid != 1) {
+ PROC *root;
+ if (!(root = find_proc(1))) {
+#ifdef WITH_SELINUX
+ root = new_proc("?", 1, 0, scontext);
+#else /*WITH_SELINUX */
+ root = new_proc("?", 1, 0);
+#endif
+ }
+ add_child(root, parent);
+ parent->parent = root;
+ }
+ }
add_child(parent, this);
this->parent = parent;
}