[PATCH] ps/libproc.a is missing clone/fork process information

Eric PAIRE (e.paire@opengroup.org)
Fri, 11 Sep 1998 08:21:56 +0200


A number of people using cloned process (mostly via the LinuxThread package)
have complained that the current ps command is unable to hide cloned processes
and to only show forked one. The (very ;-) simple 2.1.121 patch attached here
would allow the procps commands & library to differenciate processes between
"cloned" and "forked" ones, by reporting their current "p->exit_signal"
(SIGCHLD for a forked one, other for a cloned one) as a value of the
/proc/<pid>/stat output.

Best regards,
-Eric
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Eric PAIRE
Email : e.paire@gr.opengroup.org | THE Open GROUP - Grenoble Research Institute
Phone : +33 (0) 476 63 48 71 | 2, avenue de Vignate
Fax : +33 (0) 476 51 05 32 | F-38610 Gieres FRANCE
------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------
--- fs/proc/array.c.OLD Mon Sep 7 08:50:56 1998
+++ fs/proc/array.c Thu Sep 10 09:15:31 1998
@@ -844,7 +844,7 @@

return sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
%lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
-%lu %lu %lu %lu %lu %lu %lu %lu\n",
+%lu %lu %lu %lu %lu %lu %lu %lu %d\n",
pid,
tsk->comm,
state,
@@ -885,7 +885,8 @@
sigcatch .sig[0] & 0x7fffffffUL,
wchan,
tsk->nswap,
- tsk->cnswap);
+ tsk->cnswap,
+ tsk->exit_signal);
}

static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned long size,

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html