From: Craig Small Date: Mon, 21 Jun 2021 12:19:44 +0000 (+1000) Subject: pstree: Don't stop compact with pgids X-Git-Tag: v23.5rc1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=738061c3e467e0413014a444327566b9236d222d;p=psmisc pstree: Don't stop compact with pgids Showing pgids used to disable compaction. But, despite the vague NPTL documentation, its not possible to have different PGID in the same thread group, so lack of compaction is not required. With setpgid(), the last thread in the process that calls it wins. There might be a debate about should this be the right way but that's a kernel thing. References: #34 Test program https://gitlab.com/-/snippets/2094161 https://man7.org/linux/man-pages/man7/nptl.7.html --- diff --git a/ChangeLog b/ChangeLog index 601a918..543507c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Changes in NEXT =============== * pstree: Check for process with show_parents #38 + * pstree: Don't disable compaction with show pgids #34 Changes in 23.4 =============== diff --git a/doc/pstree.1 b/doc/pstree.1 index 0711954..8209cf5 100644 --- a/doc/pstree.1 +++ b/doc/pstree.1 @@ -6,7 +6,7 @@ .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" -.TH PSTREE 1 "2021-01-05" "psmisc" "User Commands" +.TH PSTREE 1 "2021-06-21" "psmisc" "User Commands" .SH NAME pstree \- display a tree of processes .SH SYNOPSIS @@ -105,9 +105,7 @@ newer than an hour yellow and the remaining red. .IP \fB\-g\fP Show PGIDs. Process Group IDs are shown as decimal numbers in parentheses after each process name. -.B \-g -implicitly disables compaction. If both PIDs and PGIDs are displayed -then PIDs are shown first. +If both PIDs and PGIDs are displayed then PIDs are shown first. .IP \fB\-G\fP Use VT100 line drawing characters. .IP \fB\-h\fP diff --git a/src/pstree.c b/src/pstree.c index 5f68765..64ea40f 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -1413,7 +1413,6 @@ int main(int argc, char **argv) break; case 'g': pgids = 1; - compact = 0; break; case 's': show_parents = 1;