Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178123838
D24380.1796041205.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
964 B
Referenced Files
None
Subscribers
None
D24380.1796041205.diff
View Options
Index: head/bin/ps/ps.c
===================================================================
--- head/bin/ps/ps.c
+++ head/bin/ps/ps.c
@@ -506,7 +506,7 @@
what = KERN_PROC_PGRP | showthreads;
flag = *pgrplist.l.pids;
nselectors = 0;
- } else if (pidlist.count == 1) {
+ } else if (pidlist.count == 1 && !descendancy) {
what = KERN_PROC_PID | showthreads;
flag = *pidlist.l.pids;
nselectors = 0;
@@ -544,6 +544,14 @@
if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0))
xo_errx(1, "%s", kvm_geterr(kd));
nkept = 0;
+ if (descendancy)
+ for (elem = 0; elem < pidlist.count; elem++)
+ for (i = 0; i < nentries; i++)
+ if (kp[i].ki_ppid == pidlist.l.pids[elem]) {
+ if (pidlist.count >= pidlist.maxcount)
+ expand_list(&pidlist);
+ pidlist.l.pids[pidlist.count++] = kp[i].ki_pid;
+ }
if (nentries > 0) {
if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL)
xo_errx(1, "malloc failed");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 12:20 PM (7 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42105741
Default Alt Text
D24380.1796041205.diff (964 B)
Attached To
Mode
D24380: ps(1): extend the non-standard option -d (tree view) to work with -p
Attached
Detach File
Event Timeline