Lines Matching refs:stat

34 #include <sys/stat.h>
54 static const char *path = "stat";
59 atf_tc_set_md_var(tc, "descr", "Test chflags(2) with stat(2)");
64 struct stat sa, sb;
67 (void)memset(&sa, 0, sizeof(struct stat));
68 (void)memset(&sb, 0, sizeof(struct stat));
73 ATF_REQUIRE(stat(path, &sa) == 0);
75 ATF_REQUIRE(stat(path, &sb) == 0);
78 atf_tc_fail("stat(2) did not detect chflags(2)");
92 atf_tc_set_md_var(tc, "descr", "Test stat(2) with directories");
98 struct stat sa, sb;
127 (void)memset(&sa, 0, sizeof(struct stat));
128 (void)memset(&sb, 0, sizeof(struct stat));
130 ATF_REQUIRE(stat(ftse->fts_parent->fts_path,&sa) == 0);
132 ATF_REQUIRE(stat(".", &sb) == 0);
135 * The previous two stat(2) calls
139 atf_tc_fail("inconsistent stat(2)");
142 * Check that fts(3)'s stat(2)
146 atf_tc_fail("stat(2) and fts(3) differ");
161 atf_tc_set_md_var(tc, "descr", "Test errors from the stat(2) family");
167 struct stat st;
175 ATF_REQUIRE_ERRNO(ENAMETOOLONG, stat(buf, &st) == -1);
181 ATF_REQUIRE_ERRNO(EFAULT, stat((void *)-1, &st) == -1);
187 ATF_REQUIRE_ERRNO(EFAULT, stat("/etc/passwd", (void *)-1) == -1);
193 ATF_REQUIRE_ERRNO(ENOENT, stat("/a/b/c/d/e/f/g/h/i/j/k", &st) == -1);
202 atf_tc_set_md_var(tc, "descr", "Test modification times with stat(2)");
207 struct stat sa, sb;
213 (void)memset(&sa, 0, sizeof(struct stat));
214 (void)memset(&sb, 0, sizeof(struct stat));
220 ATF_REQUIRE(stat(path, &sa) == 0);
225 ATF_REQUIRE(stat(path, &sb) == 0);
243 atf_tc_set_md_var(tc, "descr", "Test permissions with stat(2)");
249 struct stat sa, sb;
254 (void)memset(&sa, 0, sizeof(struct stat));
255 (void)memset(&sb, 0, sizeof(struct stat));
264 ATF_REQUIRE(stat(path, &sb) == 0);
284 atf_tc_set_md_var(tc, "descr", "Test file sizes with stat(2)");
289 struct stat sa, sb, sc;
299 (void)memset(&sa, 0, sizeof(struct stat));
300 (void)memset(&sb, 0, sizeof(struct stat));
301 (void)memset(&sc, 0, sizeof(struct stat));
306 ATF_REQUIRE(stat(path, &sc) == 0);
312 atf_tc_fail("stat(2) and fstat(2) mismatch");
334 struct stat st;
338 (void)memset(&st, 0, sizeof(struct stat));
371 atf_tc_set_md_var(tc, "descr", "Test symbolic links with stat(2)");
377 struct stat sa, sb;
380 (void)memset(&sa, 0, sizeof(struct stat));
381 (void)memset(&sb, 0, sizeof(struct stat));
387 ATF_REQUIRE(stat(pathlink, &sa) == 0);
391 atf_tc_fail("stat(2) detected symbolic link");
397 atf_tc_fail("inconsistencies between stat(2) and lstat(2)");