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
This commit is contained in:
Enji Cooper 2014-10-10 19:28:57 +00:00
parent a36f55322c
commit 9ae31714cf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272908

View File

@ -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);