summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-10-28 03:54:19 +0000
committerjhb <jhb@FreeBSD.org>2016-10-28 03:54:19 +0000
commit478722b2a7ec6b53051811d3ed26518903959cbc (patch)
tree321c9a4c78edaa1c38f1945994ec5702bcae9a3b /sys/kern
parentaf9855ea99f4ab7d966317f717777f89e634a613 (diff)
downloadFreeBSD-src-478722b2a7ec6b53051811d3ed26518903959cbc.zip
FreeBSD-src-478722b2a7ec6b53051811d3ed26518903959cbc.tar.gz
MFC 303002: Include process IDs in core dumps.
When threads were added to the kernel, the pr_pid member of the NT_PRSTATUS note was repurposed to store LWP IDs instead of process IDs. However, the process ID was no longer recorded in core dumps. This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than bumping the prpsinfo version number, note parsers can use the note's payload size to determine if pr_pid is present.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 7dc785b..293a65d 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1835,6 +1835,7 @@ __elfN(note_prpsinfo)(void *arg, struct sbuf *sb, size_t *sizep)
*cp = ' ';
}
}
+ psinfo->pr_pid = p->p_pid;
sbuf_bcat(sb, psinfo, sizeof(*psinfo));
free(psinfo, M_TEMP);
}
OpenPOWER on IntegriCloud