From 0fe8ad6bc5e70f4f6b604c03c315c75236b4dd57 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 15 Apr 2016 01:20:14 +0000 Subject: [PATCH] MFC r297637: Disable the NetBSD-specific EFAULT requirements test in gettimeofday_err FreeBSD doesn't specifically list this as a supported error, and in some configurations/versions of FreeBSD, this test will segfault as the memory address might be evaluated in userspace, instead of in kernel space like in NetBSD. --- contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c b/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c index 1cf303b08e37..4d82a26adc4c 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_gettimeofday.c @@ -46,9 +46,11 @@ ATF_TC_HEAD(gettimeofday_err, tc) ATF_TC_BODY(gettimeofday_err, tc) { +#ifdef __NetBSD__ errno = 0; ATF_REQUIRE_ERRNO(EFAULT, gettimeofday((void *)-1, NULL) != 0); +#endif } ATF_TC(gettimeofday_mono);