diff options
author | ngie <ngie@FreeBSD.org> | 2014-10-23 08:05:03 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-10-23 08:05:03 +0000 |
commit | 181c971463f823a5fd8d62dfd030214d59769ab2 (patch) | |
tree | 3ad5e263588d0ef9875cfb87e3edb854c860083b /contrib/netbsd-tests/lib/libc | |
parent | 4062bfad9ca9383731755ab8530c3f4a55b1667b (diff) | |
download | FreeBSD-src-181c971463f823a5fd8d62dfd030214d59769ab2.zip FreeBSD-src-181c971463f823a5fd8d62dfd030214d59769ab2.tar.gz |
- Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)
- Expect overflow with rlim_max at INT64_MAX, not UINT64_MAX (rlim_t is int64_t
on FreeBSD)
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c index c760cfb..45d1cdb 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c @@ -39,7 +39,9 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.4 2012/06/12 23:56:19 christos Exp $"); #include <errno.h> #include <fcntl.h> #include <limits.h> +#ifdef __NetBSD__ #include <lwp.h> +#endif #include <signal.h> #include <stdint.h> #include <stdio.h> @@ -438,6 +440,7 @@ ATF_TC_BODY(setrlimit_nproc, tc) atf_tc_fail("RLIMIT_NPROC not enforced"); } +#ifdef __NetBSD__ ATF_TC(setrlimit_nthr); ATF_TC_HEAD(setrlimit_nthr, tc) { @@ -474,6 +477,7 @@ ATF_TC_BODY(setrlimit_nthr, tc) makecontext(&c, func, 1, &lwpid); ATF_CHECK_ERRNO(EAGAIN, _lwp_create(&c, 0, &lwpid) == -1); } +#endif ATF_TC(setrlimit_perm); ATF_TC_HEAD(setrlimit_perm, tc) @@ -494,7 +498,11 @@ ATF_TC_BODY(setrlimit_perm, tc) ATF_REQUIRE(getrlimit(rlimit[i], &res) == 0); +#ifdef __FreeBSD__ + if (res.rlim_max == INT64_MAX) /* Overflow. */ +#else if (res.rlim_max == UINT64_MAX) /* Overflow. */ +#endif continue; errno = 0; @@ -516,7 +524,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, setrlimit_nofile_2); ATF_TP_ADD_TC(tp, setrlimit_nproc); ATF_TP_ADD_TC(tp, setrlimit_perm); +#ifdef __FreeBSD__ ATF_TP_ADD_TC(tp, setrlimit_nthr); +#endif return atf_no_error(); } |