1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Make kvm(3) aware of ki_jid field.

Reviewed by:	gad
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2005-03-20 10:37:56 +00:00
parent c78941e69e
commit f8197bf090
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143871

View File

@ -52,8 +52,14 @@ __FBSDID("$FreeBSD$");
*/
#include <sys/param.h>
#define _WANT_UCRED /* make ucred.h give us 'struct ucred' */
#define _WANT_UCRED /* make ucred.h give us 'struct ucred' */
#include <sys/ucred.h>
#include <sys/queue.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
#include <sys/_task.h>
#define _WANT_PRISON /* make jail.h give us 'struct prison' */
#include <sys/jail.h>
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/exec.h>
@ -105,6 +111,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
struct sigacts sigacts;
struct pstats pstats;
struct ucred ucred;
struct prison pr;
struct thread mtd;
/*struct kse mke;*/
struct ksegrp mkg;
@ -159,6 +166,15 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
bcopy(ucred.cr_groups, kp->ki_groups,
NGROUPS * sizeof(gid_t));
kp->ki_uid = ucred.cr_uid;
if (ucred.cr_prison != NULL) {
if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) {
_kvm_err(kd, kd->program,
"can't read prison at %x",
ucred.cr_prison);
return (-1);
}
kp->ki_jid = pr.pr_id;
}
}
switch(what & ~KERN_PROC_INC_THREAD) {