1/* $NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $ */ 2 3/*- 4 * Copyright (c) 2012 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Emmanuel Dreyfus. --- 151 unchanged lines hidden (view full) --- 160 ATF_REQUIRE(mkdir(DIR, 0755) == 0); 161 ATF_REQUIRE(symlink(FILE, LINK) == 0); /* NB: FILE does not exists */ 162 163 ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); 164 165 ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, 0) == -1); 166 ATF_REQUIRE(errno == ENOENT); 167 |
168#ifdef __FreeBSD__ 169 atf_tc_expect_fail("Depends on non-standard behavior not mentioned in POSIX.1-2008"); 170#endif |
171 ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, AT_SYMLINK_NOFOLLOW) == 0); 172 173 ATF_REQUIRE(close(dfd) == 0); 174} 175 176ATF_TP_ADD_TCS(tp) 177{ 178 179 ATF_TP_ADD_TC(tp, faccessat_fd); 180 ATF_TP_ADD_TC(tp, faccessat_fdcwd); 181 ATF_TP_ADD_TC(tp, faccessat_fdcwderr); 182 ATF_TP_ADD_TC(tp, faccessat_fderr1); 183 ATF_TP_ADD_TC(tp, faccessat_fderr2); 184 ATF_TP_ADD_TC(tp, faccessat_fderr3); 185 ATF_TP_ADD_TC(tp, faccessat_fdlink); 186 187 return atf_no_error(); 188} |