Link lib/libc/c063 tests to the build.

Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's
request; the includes are clearly necessary for struct stat.

The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with
faccessat(), which is not specified by POSIX.1-2008.

Differential Revision:	https://reviews.freebsd.org/D1411
Reviewed by:	ngie
This commit is contained in:
Jilles Tjoelker 2015-01-02 22:49:05 +00:00
parent 7eae632303
commit d79f904ad2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276590
5 changed files with 28 additions and 14 deletions

View File

@ -165,6 +165,9 @@ ATF_TC_BODY(faccessat_fdlink, tc)
ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, 0) == -1);
ATF_REQUIRE(errno == ENOENT);
#ifdef __FreeBSD__
atf_tc_expect_fail("Depends on non-standard behavior not mentioned in POSIX.1-2008");
#endif
ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, AT_SYMLINK_NOFOLLOW) == 0);
ATF_REQUIRE(close(dfd) == 0);

View File

@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_fchmodat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
#ifdef __FreeBSD__
#include <sys/stat.h>
#endif
#define DIR "dir"
#define FILE "dir/fchmodat"

View File

@ -41,6 +41,9 @@ __RCSID("$NetBSD: t_fchownat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $");
#include <unistd.h>
#include <pwd.h>
#include <sys/param.h>
#ifdef __FreeBSD__
#include <sys/stat.h>
#endif
#define DIR "dir"
#define FILE "dir/fchownat"

View File

@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_fstatat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $");
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
#ifdef __FreeBSD__
#include <sys/stat.h>
#endif
#define DIR "dir"
#define FILE "dir/fstatat"

View File

@ -4,21 +4,23 @@ TESTSDIR= ${TESTSBASE}/lib/libc/c063
#TODO: t_o_search, t_utimensat
NETBSD_ATF_TESTS_C= t_faccessat
NETBSD_ATF_TESTS_C+= t_fchmodat
NETBSD_ATF_TESTS_C+= t_fchownat
NETBSD_ATF_TESTS_C+= t_fexecve
NETBSD_ATF_TESTS_C+= t_fstatat
NETBSD_ATF_TESTS_C+= t_linkat
NETBSD_ATF_TESTS_C+= t_mkdirat
NETBSD_ATF_TESTS_C+= t_mkfifoat
NETBSD_ATF_TESTS_C+= t_mknodat
NETBSD_ATF_TESTS_C+= t_openat
NETBSD_ATF_TESTS_C+= t_readlinkat
NETBSD_ATF_TESTS_C+= t_renameat
NETBSD_ATF_TESTS_C+= t_symlinkat
NETBSD_ATF_TESTS_C+= t_unlinkat
NETBSD_ATF_TESTS_C= faccessat
NETBSD_ATF_TESTS_C+= fchmodat
NETBSD_ATF_TESTS_C+= fchownat
NETBSD_ATF_TESTS_C+= fexecve
NETBSD_ATF_TESTS_C+= fstatat
NETBSD_ATF_TESTS_C+= linkat
NETBSD_ATF_TESTS_C+= mkdirat
NETBSD_ATF_TESTS_C+= mkfifoat
NETBSD_ATF_TESTS_C+= mknodat
NETBSD_ATF_TESTS_C+= openat
NETBSD_ATF_TESTS_C+= readlinkat
NETBSD_ATF_TESTS_C+= renameat
NETBSD_ATF_TESTS_C+= symlinkat
NETBSD_ATF_TESTS_C+= unlinkat
CFLAGS+= -D_INCOMPLETE_XOPEN_C063
.include "../Makefile.netbsd-tests"
.include <bsd.test.mk>