diff options
author | Julian Elischer <julian@FreeBSD.org> | 2006-01-18 20:27:43 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 2006-01-18 20:27:43 +0000 |
commit | 11f4763dd4b07b7bf0475f97a96e0bda1ef427f4 (patch) | |
tree | d8f34c4e4d6bdf40a339a8bdac20316749866083 /sys/kern/kern_proc.c | |
parent | e1189b25d4b0da90d64194e497b9b24252343e86 (diff) | |
download | src-11f4763dd4b07b7bf0475f97a96e0bda1ef427f4.tar.gz src-11f4763dd4b07b7bf0475f97a96e0bda1ef427f4.zip |
Return the thread name in the kinfo_proc structure.
Also correct the comment describing what the value is.
Notes
Notes:
svn path=/head/; revision=154535
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index d2bcf0f0834d..59d257b4f89f 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -737,6 +737,11 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_tdev = NODEV; if (p->p_comm[0] != '\0') { strlcpy(kp->ki_comm, p->p_comm, sizeof(kp->ki_comm)); + /* + * Temporarily give the thread a default name of the process + * as it's erroneously used in the snmp code. + * Remove this when that is fixed. (soon I'm told) + */ strlcpy(kp->ki_ocomm, p->p_comm, sizeof(kp->ki_ocomm)); } if (p->p_sysent && p->p_sysent->sv_name != NULL && @@ -766,6 +771,8 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); else bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); + if (td->td_name[0] != '\0') + strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm)); if (TD_ON_LOCK(td)) { kp->ki_kiflag |= KI_LOCKBLOCK; strlcpy(kp->ki_lockname, td->td_lockname, |