Index: sys/kern/imgact_elf.c =================================================================== --- sys/kern/imgact_elf.c +++ sys/kern/imgact_elf.c @@ -1838,6 +1838,7 @@ */ strlcpy(psinfo->pr_psargs, p->p_comm, sizeof(psinfo->pr_psargs)); + psinfo->pr_pid = p->p_pid; sbuf_bcat(sb, psinfo, sizeof(*psinfo)); free(psinfo, M_TEMP); Index: sys/sys/procfs.h =================================================================== --- sys/sys/procfs.h +++ sys/sys/procfs.h @@ -61,7 +61,7 @@ size_t pr_fpregsetsz; /* sizeof(fpregset_t) (1) */ int pr_osreldate; /* Kernel version (1) */ int pr_cursig; /* Current signal (1) */ - pid_t pr_pid; /* Process ID (1) */ + pid_t pr_pid; /* LWP ID (1) */ gregset_t pr_reg; /* General purpose registers (1) */ } prstatus_t; @@ -71,13 +71,14 @@ #define PRFNAMESZ 16 /* Maximum command length saved */ #define PRARGSZ 80 /* Maximum argument bytes saved */ -#define PRPSINFO_VERSION 1 /* Current version of prpsinfo_t */ +#define PRPSINFO_VERSION 2 /* Current version of prpsinfo_t */ typedef struct prpsinfo { int pr_version; /* Version number of struct (1) */ size_t pr_psinfosz; /* sizeof(prpsinfo_t) (1) */ char pr_fname[PRFNAMESZ+1]; /* Command name, null terminated (1) */ char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ + pid_t pr_pid; /* Process ID (2) */ } prpsinfo_t; typedef struct thrmisc { @@ -104,6 +105,7 @@ uint32_t pr_psinfosz; char pr_fname[PRFNAMESZ+1]; char pr_psargs[PRARGSZ+1]; + int32_t pr_pid; } prpsinfo32_t; struct thrmisc32 { Index: usr.bin/gcore/elfcore.c =================================================================== --- usr.bin/gcore/elfcore.c +++ usr.bin/gcore/elfcore.c @@ -562,6 +562,7 @@ err(1, "kern.proc.pid.%u", pid); strlcpy(psinfo->pr_fname, kip.ki_comm, sizeof(psinfo->pr_fname)); strlcpy(psinfo->pr_psargs, psinfo->pr_fname, sizeof(psinfo->pr_psargs)); + psinfo->pr_pid = pid; *sizep = sizeof(*psinfo); return (psinfo);