. Added printing of ppid to PM dump output

. made PM pid 0, own parent (so ppid 0) instead of -1
This commit is contained in:
Ben Gras 2005-07-04 09:36:16 +00:00
parent af9465adbd
commit 08f67dcef7
3 changed files with 5 additions and 6 deletions

View file

@ -26,14 +26,14 @@ PUBLIC void mproc_dmp()
getsysinfo(PM_PROC_NR, SI_PROC_TAB, mproc);
printf("-process- -nr-prnt- -pid/grp- --uid---gid-- -flags- --ignore--catch--block--\n");
printf("-process- -nr-prnt- -pid/ppid/grp --uid--gid- -flags- --ignore--catch--block--\n");
for (i=prev_i; i<NR_PROCS; i++) {
mp = &mproc[i];
if (mp->mp_pid == 0 && i != PM_PROC_NR) continue;
if (++n > 22) break;
printf("%8.8s %4d%4d %4d%4d ",
mp->mp_name, i, mp->mp_parent, mp->mp_pid, mp->mp_procgrp);
printf("%d (%d) %d (%d) ",
printf("%8.8s %4d%4d %4d%4d%4d ",
mp->mp_name, i, mp->mp_parent, mp->mp_pid, mproc[mp->mp_parent].mp_pid, mp->mp_procgrp);
printf("%d(%d) %d(%d) ",
mp->mp_realuid, mp->mp_effuid, mp->mp_realgid, mp->mp_effgid);
printf("0x%04x ",
mp->mp_flags);

View file

@ -17,7 +17,6 @@
*/
#define PM_PID 0 /* PM's process id number */
#define PM_PARENT -1 /* PM's parent process slot */
#define INIT_PID 1 /* INIT's process id number */

View file

@ -216,7 +216,7 @@ PRIVATE void pm_init()
sigemptyset(&mproc[INIT_PROC_NR].mp_sigmask);
mproc[PM_PROC_NR].mp_pid = PM_PID;
mproc[PM_PROC_NR].mp_parent = PM_PARENT;
mproc[PM_PROC_NR].mp_parent = PM_PROC_NR;
sigfillset(&mproc[PM_PROC_NR].mp_ignore);
sigfillset(&mproc[PM_PROC_NR].mp_sigmask);