Home | History | Annotate | Download | only in sys

Lines Matching refs:stat

34 #include <sys/stat.h>
51 static const char *path = "stat";
56 atf_tc_set_md_var(tc, "descr", "Test chflags(2) with stat(2)");
61 struct stat sa, sb;
64 (void)memset(&sa, 0, sizeof(struct stat));
65 (void)memset(&sb, 0, sizeof(struct stat));
70 ATF_REQUIRE(stat(path, &sa) == 0);
72 ATF_REQUIRE(stat(path, &sb) == 0);
75 atf_tc_fail("stat(2) did not detect chflags(2)");
89 atf_tc_set_md_var(tc, "descr", "Test stat(2) with directories");
95 struct stat sa, sb;
124 (void)memset(&sa, 0, sizeof(struct stat));
125 (void)memset(&sb, 0, sizeof(struct stat));
127 ATF_REQUIRE(stat(ftse->fts_parent->fts_path,&sa) == 0);
129 ATF_REQUIRE(stat(".", &sb) == 0);
132 * The previous two stat(2) calls
136 atf_tc_fail("inconsistent stat(2)");
139 * Check that fts(3)'s stat(2)
143 atf_tc_fail("stat(2) and fts(3) differ");
158 atf_tc_set_md_var(tc, "descr", "Test errors from the stat(2) family");
164 struct stat st;
172 ATF_REQUIRE_ERRNO(ENAMETOOLONG, stat(buf, &st) == -1);
178 ATF_REQUIRE_ERRNO(EFAULT, stat((void *)-1, &st) == -1);
184 ATF_REQUIRE_ERRNO(EFAULT, stat("/etc/passwd", (void *)-1) == -1);
190 ATF_REQUIRE_ERRNO(ENOENT, stat("/a/b/c/d/e/f/g/h/i/j/k", &st) == -1);
199 atf_tc_set_md_var(tc, "descr", "Test modification times with stat(2)");
204 struct stat sa, sb;
210 (void)memset(&sa, 0, sizeof(struct stat));
211 (void)memset(&sb, 0, sizeof(struct stat));
217 ATF_REQUIRE(stat(path, &sa) == 0);
222 ATF_REQUIRE(stat(path, &sb) == 0);
240 atf_tc_set_md_var(tc, "descr", "Test permissions with stat(2)");
246 struct stat sa, sb;
251 (void)memset(&sa, 0, sizeof(struct stat));
252 (void)memset(&sb, 0, sizeof(struct stat));
261 ATF_REQUIRE(stat(path, &sb) == 0);
281 atf_tc_set_md_var(tc, "descr", "Test file sizes with stat(2)");
286 struct stat sa, sb, sc;
296 (void)memset(&sa, 0, sizeof(struct stat));
297 (void)memset(&sb, 0, sizeof(struct stat));
298 (void)memset(&sc, 0, sizeof(struct stat));
303 ATF_REQUIRE(stat(path, &sc) == 0);
309 atf_tc_fail("stat(2) and fstat(2) mismatch");
331 struct stat st;
335 (void)memset(&st, 0, sizeof(struct stat));
368 atf_tc_set_md_var(tc, "descr", "Test symbolic links with stat(2)");
374 struct stat sa, sb;
377 (void)memset(&sa, 0, sizeof(struct stat));
378 (void)memset(&sb, 0, sizeof(struct stat));
384 ATF_REQUIRE(stat(pathlink, &sa) == 0);
388 atf_tc_fail("stat(2) detected symbolic link");
394 atf_tc_fail("inconsistencies between stat(2) and lstat(2)");