Lines Matching refs:dirfd
380 static int test_open_rel(const int dirfd, const char *const path, in test_open_rel() argument
386 fd = openat(dirfd, path, flags | O_CLOEXEC); in test_open_rel()
1704 int dirfd, ruleset_fd; in test_relative_path() local
1734 dirfd = open(dir_s1d2, O_DIRECTORY); in test_relative_path()
1735 ASSERT_LE(0, dirfd); in test_relative_path()
1739 dirfd = AT_FDCWD; in test_relative_path()
1747 dirfd = AT_FDCWD; in test_relative_path()
1755 dirfd = AT_FDCWD; in test_relative_path()
1760 test_open_rel(dirfd, "..", O_RDONLY)); in test_relative_path()
1761 ASSERT_EQ(0, test_open_rel(dirfd, ".", O_RDONLY)); in test_relative_path()
1765 ASSERT_EQ(0, test_open_rel(dirfd, "./s2d3", O_RDONLY)); in test_relative_path()
1768 ASSERT_EQ(0, test_open_rel(dirfd, "./s1d3", O_RDONLY)); in test_relative_path()
1773 ASSERT_EQ(0, test_open_rel(dirfd, "/..", O_RDONLY)); in test_relative_path()
1774 ASSERT_EQ(0, test_open_rel(dirfd, "/", O_RDONLY)); in test_relative_path()
1775 ASSERT_EQ(0, test_open_rel(dirfd, "/f1", O_RDONLY)); in test_relative_path()
1776 ASSERT_EQ(0, test_open_rel(dirfd, "/s1d3", O_RDONLY)); in test_relative_path()
1780 ASSERT_EQ(EACCES, test_open_rel(dirfd, "../../s1d1", O_RDONLY)); in test_relative_path()
1781 ASSERT_EQ(0, test_open_rel(dirfd, "../../s1d1/s1d2", O_RDONLY)); in test_relative_path()
1782 ASSERT_EQ(0, test_open_rel(dirfd, "../../s1d1/s1d2/s1d3", in test_relative_path()
1785 ASSERT_EQ(EACCES, test_open_rel(dirfd, "../../s2d1", O_RDONLY)); in test_relative_path()
1786 ASSERT_EQ(0, test_open_rel(dirfd, "../../s2d1/s2d2", O_RDONLY)); in test_relative_path()
1787 ASSERT_EQ(0, test_open_rel(dirfd, "../../s2d1/s2d2/s2d3", in test_relative_path()
1792 ASSERT_EQ(0, close(dirfd)); in test_relative_path()