FreeBSD/tools/regression/priv/priv_proc_setrlimit.c
void
priv_proc_setrlimit_raisecur_nopriv(int asroot, int injail,
    struct test *test)
{
	struct rlimit rl;
	int error;

	rl = rl_lowered;
	rl.rlim_cur = rl.rlim_max;
	error = setrlimit(RLIMIT_DATA, &rl);
	if (asroot && injail)
		expect("priv_proc_setrlimit_raiscur_nopriv(asroot, injail)",
		    error, 0, 0);
	if (asroot && !injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(asroot, !injail)",
		    error, 0, 0);
	if (!asroot && injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(!asroot, injail)",
		    error, 0, 0);
	if (!asroot && !injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(!asroot, !injail)",
		    error, 0, 0);
}
/*
 * Try setting the current limit to the current maximum, which is allowed
 * without privilege.
 */
Try setting the current limit to the current maximum, which is allowed
without privilege.
Try setting the current limit to the current maximum which is allowed without privilege .
void
priv_proc_setrlimit_raisecur_nopriv(int asroot, int injail,
    struct test *test)
{
	struct rlimit rl;
	int error;
	rl = rl_lowered;
	rl.rlim_cur = rl.rlim_max;
	error = setrlimit(RLIMIT_DATA, &rl);
	if (asroot && injail)
		expect("priv_proc_setrlimit_raiscur_nopriv(asroot, injail)",
		    error, 0, 0);
	if (asroot && !injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(asroot, !injail)",
		    error, 0, 0);
	if (!asroot && injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(!asroot, injail)",
		    error, 0, 0);
	if (!asroot && !injail)
		expect("priv_proc_setrlimit_raisecur_nopriv(!asroot, !injail)",
		    error, 0, 0);
}
void priv_proc_setrlimit_raisecur_nopriv ( int asroot , int injail , struct test * test ) { struct rlimit rl ; int error ; rl = rl_lowered ; rl . rlim_cur = rl . rlim_max ; error = setrlimit ( RLIMIT_DATA , & rl ) ; if ( asroot && injail ) expect ( " " , error , 0 , 0 ) ; if ( asroot && ! injail ) expect ( " " , error , 0 , 0 ) ; if ( ! asroot && injail ) expect ( " " , error , 0 , 0 ) ; if ( ! asroot && ! injail ) expect ( " " , error , 0 , 0 ) ; }
Try setting the current limit to the current maximum, which is allowed
 without privilege.
Try setting the current limit to the current maximum which is allowed without privilege .