diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2014-10-12 21:53:13 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2014-10-12 21:53:13 +0000 |
commit | f12a8d0b052646f62f391dfec0884f2762a52f6a (patch) | |
tree | 2af1855b3edb27c1e544564ee61b6d0e801054fb /contrib/netbsd-tests/lib/libc/regex | |
parent | d49c6f029c3aeb62bcea97004159377efb72692c (diff) |
Notes
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/regex')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/regex/t_exhaust.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c index 468492c293aa3..bc34441fe4c79 100644 --- a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c +++ b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c @@ -45,6 +45,9 @@ __RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $"); #include <stdlib.h> #include <err.h> #include <atf-c.h> +#if defined(__FreeBSD__) +#include <sys/resource.h> +#endif #ifndef REGEX_MAXSIZE #define REGEX_MAXSIZE 9999 @@ -176,14 +179,25 @@ ATF_TC_HEAD(regcomp_too_big, tc) " crash, but return a proper error code"); // libtre needs it. atf_tc_set_md_var(tc, "timeout", "600"); +#if defined(__FreeBSD__) + atf_tc_set_md_var(tc, "require.memory", "64M"); +#else atf_tc_set_md_var(tc, "require.memory", "120M"); +#endif } ATF_TC_BODY(regcomp_too_big, tc) { regex_t re; +#if defined(__FreeBSD__) + struct rlimit limit; +#endif int e; +#if defined(__FreeBSD__) + limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024; + ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); +#endif for (size_t i = 0; i < __arraycount(tests); i++) { char *d = (*tests[i].pattern)(REGEX_MAXSIZE); e = regcomp(&re, d, tests[i].type); |