From e69f1fa2ef7e3463fa319b728de5ab61f59a410e Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 20 Mar 2005 10:33:27 +0000 Subject: [PATCH] Make prison structure visible from userland if _WANT_PRISON is defined (simlar to _WANT_UCRED). Reviewed by: gad MFC after: 3 days --- sys/sys/jail.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index b403b14799b4..73d6940ab606 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -46,6 +46,7 @@ int jail_attach(int); #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PRISON); #endif +#endif /* _KERNEL */ /* * This structure describes a prison. It is pointed to by all struct @@ -59,6 +60,7 @@ MALLOC_DECLARE(M_PRISON); * required to read * (d) set only during destruction of jail, no mutex needed */ +#if defined(_KERNEL) || defined(_WANT_PRISON) struct prison { LIST_ENTRY(prison) pr_list; /* (a) all prisons */ int pr_id; /* (c) prison id */ @@ -72,7 +74,9 @@ struct prison { struct task pr_task; /* (d) destroy task */ struct mtx pr_mtx; }; +#endif /* _KERNEL || _WANT_PRISON */ +#ifdef _KERNEL /* * Sysctl-set variables that determine global jail policy * @@ -105,5 +109,5 @@ int prison_if(struct ucred *cred, struct sockaddr *sa); int prison_ip(struct ucred *cred, int flag, u_int32_t *ip); void prison_remote_ip(struct ucred *cred, int flags, u_int32_t *ip); -#endif /* !_KERNEL */ +#endif /* _KERNEL */ #endif /* !_SYS_JAIL_H_ */