Changeset View
Changeset View
Standalone View
Standalone View
contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | |||||
ATF_TC_BODY(setrlimit_stack, tc) | ATF_TC_BODY(setrlimit_stack, tc) | ||||
{ | { | ||||
struct rlimit res; | struct rlimit res; | ||||
if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) | if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) | ||||
atf_tc_skip("https://bugs.freebsd.org/259969"); | atf_tc_skip("https://bugs.freebsd.org/259969"); | ||||
/* Ensure soft limit is not bigger than hard limit */ | /* Ensure soft limit is not bigger than hard limit */ | ||||
#ifdef __FreeBSD__ | |||||
res.rlim_cur = res.rlim_max = 20971520; | |||||
#else | |||||
res.rlim_cur = res.rlim_max = 4192256; | res.rlim_cur = res.rlim_max = 4192256; | ||||
#endif | |||||
ATF_REQUIRE(setrlimit(RLIMIT_STACK, &res) == 0); | ATF_REQUIRE(setrlimit(RLIMIT_STACK, &res) == 0); | ||||
ATF_REQUIRE(getrlimit(RLIMIT_STACK, &res) == 0); | ATF_REQUIRE(getrlimit(RLIMIT_STACK, &res) == 0); | ||||
ATF_CHECK(res.rlim_cur <= res.rlim_max); | ATF_CHECK(res.rlim_cur <= res.rlim_max); | ||||
} | } | ||||
ATF_TP_ADD_TCS(tp) | ATF_TP_ADD_TCS(tp) | ||||
{ | { | ||||
Show All 17 Lines |