1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Karels at Berkeley Software Design, Inc.
7 *
8 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
--- 22 unchanged lines hidden (view full) ---
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 141013 2005-01-30 00:31:19Z rwatson $");
40
41#include "opt_posix.h"
42
43#include <sys/param.h>
44#include <sys/kernel.h>
45#include <sys/systm.h>
46#include <sys/sysctl.h>
47#include <sys/proc.h>
--- 199 unchanged lines hidden (view full) ---
247 struct prison *pr;
248 int error, level;
249
250 pr = req->td->td_ucred->cr_prison;
251
252 /*
253 * If the process is in jail, return the maximum of the global and
254 * local levels; otherwise, return the global level. Perform a
255 * lockless read since the securelevel is an integer.
256 */
257 if (pr != NULL)
258 level = imax(securelevel, pr->pr_securelevel);
259 else
260 level = securelevel;
261 error = sysctl_handle_int(oidp, &level, 0, req);
262 if (error || !req->newptr)
263 return (error);
--- 111 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Karels at Berkeley Software Design, Inc.
7 *
8 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
--- 22 unchanged lines hidden (view full) ---
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 141013 2005-01-30 00:31:19Z rwatson $");
40
41#include "opt_posix.h"
42
43#include <sys/param.h>
44#include <sys/kernel.h>
45#include <sys/systm.h>
46#include <sys/sysctl.h>
47#include <sys/proc.h>
--- 199 unchanged lines hidden (view full) ---
247 struct prison *pr;
248 int error, level;
249
250 pr = req->td->td_ucred->cr_prison;
251
252 /*
253 * If the process is in jail, return the maximum of the global and
254 * local levels; otherwise, return the global level. Perform a
255 * lockless read since the securelevel is an integer.
256 */
257 if (pr != NULL)
258 level = imax(securelevel, pr->pr_securelevel);
259 else
260 level = securelevel;
261 error = sysctl_handle_int(oidp, &level, 0, req);
262 if (error || !req->newptr)
263 return (error);
--- 111 unchanged lines hidden ---