FreeBSD/tools/regression/priv/priv_proc_setrlimit.c
/*
 * Try raising the current limits above the maximum, which requires
 * privilege.
 */
Try raising the current limits above the maximum, which requires
privilege.
Try raising the current limits above the maximum which requires privilege .
void
priv_proc_setrlimit_raisecur(int asroot, int injail, struct test *test)
{
	struct rlimit rl;
	int error;
	rl = rl_lowered;
	rl.rlim_cur = rl.rlim_max + 10;
	error = setrlimit(RLIMIT_DATA, &rl);
	if (asroot && injail)
		expect("priv_proc_setrlimit_raisecur(asroot, injail)", error,
		    0, 0);
	if (asroot && !injail)
		expect("priv_proc_setrlimit_raisecur(asroot, !injail)",
		    error, 0, 0);
	if (!asroot && injail)
		expect("priv_proc_setrlimit_raisecur(!asroot, injail)",
		    error, -1, EPERM);
	if (!asroot && !injail)
		expect("priv_proc_setrlimit_raisecur(!asroot, !injail)",
		    error, -1, EPERM);
}
void priv_proc_setrlimit_raisecur ( int asroot , int injail , struct test * test ) { struct rlimit rl ; int error ; rl = rl_lowered ; rl . rlim_cur = rl . rlim_max + 10 ; error = setrlimit ( RLIMIT_DATA , & rl ) ; if ( asroot && injail ) expect ( " " , error , 0 , 0 ) ; if ( asroot && ! injail ) expect ( " " , error , 0 , 0 ) ; if ( ! asroot && injail ) expect ( " " , error , -1 , EPERM ) ; if ( ! asroot && ! injail ) expect ( " " , error , -1 , EPERM ) ; }
Try raising the current limits above the maximum, which requires
 privilege.
Try raising the current limits above the maximum which requires privilege .