FreeBSD/sys/kern/kern_prot.c
/*
 * Test the active securelevel against a given level.  securelevel_gt()
 * implements (securelevel > level).  securelevel_ge() implements
 * (securelevel >= level).  Note that the logic is inverted -- these
 * functions return EPERM on "success" and 0 on "failure".
 *
 * Due to care taken when setting the securelevel, we know that no jail will
 * be less secure that its parent (or the physical system), so it is sufficient
 * to test the current jail only.
 *
 * XXXRW: Possibly since this has to do with privilege, it should move to
 * kern_priv.c.
 */
Test the active securelevel against a given level.  securelevel_gt()
implements (securelevel > level).  securelevel_ge() implements
(securelevel >= level).  Note that the logic is inverted -- these
functions return EPERM on "success" and 0 on "failure".

Due to care taken when setting the securelevel, we know that no jail will
be less secure that its parent (or the physical system), so it is sufficient
to test the current jail only.

Possibly since this has to do with privilege, it should move to
kern_priv.c.
Test the active securelevel against a given level . securelevel_gt () implements ( securelevel > level ) . securelevel_ge () implements ( securelevel > = level ) . Note that the logic is inverted -- these functions return EPERM on " success " and 0 on " failure " . Due to care taken when setting the securelevel we know that no jail will be less secure that its parent ( or the physical system ) so it is sufficient to test the current jail only . Possibly since this has to do with privilege it should move to kern_priv . c .
int
securelevel_gt(struct ucred *cr, int level)
{
	return (cr->cr_prison->pr_securelevel > level ? EPERM : 0);
}
int securelevel_gt ( struct ucred * cr , int level ) { return ( cr -> cr_prison -> pr_securelevel > level ? EPERM : 0 ) ; }
Test the active securelevel against a given level.
Test the active securelevel against a given level .