summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-10-24 03:53:49 +0000
committerngie <ngie@FreeBSD.org>2014-10-24 03:53:49 +0000
commitc0ab1074a0faa23ab26636bbcf4d7184190ce5d1 (patch)
treeb492e95812f9e286b44e3e0994be0d4231884b86 /contrib/netbsd-tests
parent043b7b066a4a6d413f2064709a0619adbf30caf6 (diff)
downloadFreeBSD-src-c0ab1074a0faa23ab26636bbcf4d7184190ce5d1.zip
FreeBSD-src-c0ab1074a0faa23ab26636bbcf4d7184190ce5d1.tar.gz
- Test for EINVAL requirement when passing an invalid flag in to msync(2)
- Expect ENOMEM instead of EFAULT when msync'ing a previously munmap'ed region on FreeBSD Submitted by: pho Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_msync.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msync.c b/contrib/netbsd-tests/lib/libc/sys/t_msync.c
index 9743300..70d0ccf 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_msync.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_msync.c
@@ -170,8 +170,15 @@ ATF_TC_BODY(msync_err, tc)
/*
* Test that invalid flags error out.
*/
+#ifdef __FreeBSD__
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, msync_sync("error", -1) != NULL);
+ errno = 0;
+ ATF_REQUIRE_ERRNO(EINVAL, msync_sync("error", INT_MAX) != NULL);
+#else
ATF_REQUIRE(msync_sync("error", -1) != NULL);
ATF_REQUIRE(msync_sync("error", INT_MAX) != NULL);
+#endif
errno = 0;
@@ -185,7 +192,11 @@ ATF_TC_BODY(msync_err, tc)
(void)munmap(map, page);
ATF_REQUIRE(msync(map, page, MS_SYNC) != 0);
+#ifdef __FreeBSD__
+ ATF_REQUIRE(errno == ENOMEM);
+#else
ATF_REQUIRE(errno == EFAULT);
+#endif
}
ATF_TC(msync_invalidate);
OpenPOWER on IntegriCloud