summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-10-10 19:28:57 +0000
committerngie <ngie@FreeBSD.org>2014-10-10 19:28:57 +0000
commitd20db9d537a86bd3d2904192e5fa0a74b9decc7a (patch)
treee64a9465cd8487e469ba38bfedcf0b0197c98ef6 /contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
parent2b6232c7be171d19228e79a5f2e3f76f15342612 (diff)
downloadFreeBSD-src-d20db9d537a86bd3d2904192e5fa0a74b9decc7a.zip
FreeBSD-src-d20db9d537a86bd3d2904192e5fa0a74b9decc7a.tar.gz
Disable the invalid pointer test on FreeBSD
FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the address passed in in libc, whereas NetBSD just passes the information off to the syscall, which allows the kernel to return EFAULT on bad pointers. In collaboration with: pho Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/gen/t_getcwd.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_getcwd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
index 76c287a..bb3baf0 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_getcwd.c
@@ -56,10 +56,12 @@ ATF_TC_BODY(getcwd_err, tc)
ATF_REQUIRE(getcwd(buf, 0) == NULL);
ATF_REQUIRE(errno == EINVAL);
+#if defined(__NetBSD__)
errno = 0;
ATF_REQUIRE(getcwd((void *)-1, sizeof(buf)) == NULL);
ATF_REQUIRE(errno == EFAULT);
+#endif
}
ATF_TC(getcwd_fts);
OpenPOWER on IntegriCloud