From ce42f55037f8e98c56e383a638ef27ea9f9e7719 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 29 Oct 2006 22:34:07 +0000 Subject: [PATCH] add the emulation in kinfo_proc2 --- sys/kern/init_sysctl.c | 7 +++++-- sys/sys/sysctl.h | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_sysctl.c b/sys/kern/init_sysctl.c index 0a105f4cdb12..168bbe5e58ab 100644 --- a/sys/kern/init_sysctl.c +++ b/sys/kern/init_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_sysctl.c,v 1.89 2006/10/03 16:07:12 elad Exp $ */ +/* $NetBSD: init_sysctl.c,v 1.90 2006/10/29 22:34:07 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.89 2006/10/03 16:07:12 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.90 2006/10/29 22:34:07 christos Exp $"); #include "opt_sysv.h" #include "opt_multiprocessor.h" @@ -2990,6 +2990,9 @@ fill_kproc2(struct proc *p, struct kinfo_proc2 *ki) strncpy(ki->p_login, p->p_session->s_login, min(sizeof ki->p_login - 1, sizeof p->p_session->s_login)); + strncpy(ki->p_ename, p->p_emul->e_name, sizeof(ki->p_ename)); + ki->p_ename[sizeof(ki->p_ename) - 1] = '\0'; + ki->p_nlwps = p->p_nlwps; ki->p_nrlwps = p->p_nrlwps; ki->p_realflag = p->p_flag; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 7289b7961876..83065be79033 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.h,v 1.160 2006/10/12 01:32:51 christos Exp $ */ +/* $NetBSD: sysctl.h,v 1.161 2006/10/29 22:34:07 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -439,6 +439,7 @@ struct kinfo_proc { #define KI_MAXCOMLEN 24 /* extra for 8 byte alignment */ #define KI_WMESGLEN 8 #define KI_MAXLOGNAME 24 /* extra for 8 byte alignment */ +#define KI_MAXEMULLEN 16 #define KI_NOCPU (~(uint64_t)0) @@ -561,6 +562,7 @@ struct kinfo_proc2 { uint64_t p_realstat; /* LONG: non-LWP process status */ uint32_t p_svuid; /* UID_T: saved user id */ uint32_t p_svgid; /* GID_T: saved group id */ + char p_ename[KI_MAXEMULLEN]; /* emulation name */ }; /*