From 1a8cc2bad92d7f1305d57aac3ee82e82117aab70 Mon Sep 17 00:00:00 2001 From: bz Date: Mon, 18 Jul 2011 20:06:15 +0000 Subject: Rename ki_ocomm to ki_tdname and OCOMMLEN to TDNAMLEN. Provide backward compatibility defines under BURN_BRIDGES. Suggested by: jhb Reviewed by: emaste Sponsored by: Sandvine Incorporated Approved by: re (kib) --- sys/compat/freebsd32/freebsd32.h | 2 +- sys/kern/kern_proc.c | 4 ++-- sys/sys/user.h | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 82bdc53..5d1a269 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -310,7 +310,7 @@ struct kinfo_proc32 { char ki_rqindex; u_char ki_oncpu; u_char ki_lastcpu; - char ki_ocomm[OCOMMLEN+1]; + char ki_tdname[TDNAMLEN+1]; char ki_wmesg[WMESGLEN+1]; char ki_login[LOGNAMELEN+1]; char ki_lockname[LOCKNAMELEN+1]; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index aac8b39..91b14a9 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -855,7 +855,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread) strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); else bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); - strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm)); + strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)); if (TD_ON_LOCK(td)) { kp->ki_kiflag |= KI_LOCKBLOCK; strlcpy(kp->ki_lockname, td->td_lockname, @@ -1059,7 +1059,7 @@ freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, struct kinfo_proc32 *ki32) CP(*ki, *ki32, ki_rqindex); CP(*ki, *ki32, ki_oncpu); CP(*ki, *ki32, ki_lastcpu); - bcopy(ki->ki_ocomm, ki32->ki_ocomm, OCOMMLEN + 1); + bcopy(ki->ki_tdname, ki32->ki_tdname, TDNAMLEN + 1); bcopy(ki->ki_wmesg, ki32->ki_wmesg, WMESGLEN + 1); bcopy(ki->ki_login, ki32->ki_login, LOGNAMELEN + 1); bcopy(ki->ki_lockname, ki32->ki_lockname, LOCKNAMELEN + 1); diff --git a/sys/sys/user.h b/sys/sys/user.h index 644f911..1863f86 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -95,13 +95,18 @@ #define WMESGLEN 8 /* size of returned wchan message */ #define LOCKNAMELEN 8 /* size of returned lock name */ -#define OCOMMLEN 16 /* size of returned thread name */ +#define TDNAMLEN 16 /* size of returned thread name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_EMULNAMELEN 16 /* size of returned ki_emul */ #define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ #define LOGINCLASSLEN 17 /* size of returned ki_loginclass */ +#ifndef BURN_BRIDGES +#define OCOMMLEN TDNAMLEN +#define ki_ocomm ki_tdname +#endif + /* Flags for the process credential. */ #define KI_CRF_CAPABILITY_MODE 0x00000001 /* @@ -167,7 +172,7 @@ struct kinfo_proc { char ki_rqindex; /* Run queue index */ u_char ki_oncpu; /* Which cpu we are on */ u_char ki_lastcpu; /* Last cpu we were on */ - char ki_ocomm[OCOMMLEN+1]; /* thread name */ + char ki_tdname[TDNAMLEN+1]; /* thread name */ char ki_wmesg[WMESGLEN+1]; /* wchan message */ char ki_login[LOGNAMELEN+1]; /* setlogin name */ char ki_lockname[LOCKNAMELEN+1]; /* lock name */ -- cgit v1.1