Home
last modified time | relevance | path

Searched refs:stat_buf (Results 1 – 25 of 66) sorted by relevance

123

/third_party/libuv/test/
Dtest-pipe-set-fchmod.c31 struct stat stat_buf; in TEST_IMPL() local
51 stat(TEST_PIPENAME, &stat_buf); in TEST_IMPL()
52 ASSERT(stat_buf.st_mode & S_IRUSR); in TEST_IMPL()
53 ASSERT(stat_buf.st_mode & S_IRGRP); in TEST_IMPL()
54 ASSERT(stat_buf.st_mode & S_IROTH); in TEST_IMPL()
60 stat(TEST_PIPENAME, &stat_buf); in TEST_IMPL()
61 ASSERT(stat_buf.st_mode & S_IWUSR); in TEST_IMPL()
62 ASSERT(stat_buf.st_mode & S_IWGRP); in TEST_IMPL()
63 ASSERT(stat_buf.st_mode & S_IWOTH); in TEST_IMPL()
69 stat(TEST_PIPENAME, &stat_buf); in TEST_IMPL()
[all …]
/third_party/ltp/testcases/kernel/syscalls/stat/
Dstat01.c40 struct stat stat_buf; in verify_stat() local
43 TEST(stat(tc->pathname, &stat_buf)); in verify_stat()
50 if (stat_buf.st_uid != user_id) { in verify_stat()
52 stat_buf.st_uid, user_id); in verify_stat()
56 if (stat_buf.st_gid != group_id) { in verify_stat()
58 stat_buf.st_gid, group_id); in verify_stat()
62 if (stat_buf.st_size != FILE_SIZE) { in verify_stat()
64 (long)stat_buf.st_size, FILE_SIZE); in verify_stat()
68 if ((stat_buf.st_mode & MASK) != tc->mode) { in verify_stat()
70 (stat_buf.st_mode & MASK), tc->mode); in verify_stat()
[all …]
/third_party/f2fs-tools/mkfs/
Df2fs_format_utils.c56 struct stat *stat_buf; in trim_device() local
61 stat_buf = malloc(sizeof(struct stat)); in trim_device()
62 if (stat_buf == NULL) { in trim_device()
67 if (fstat(fd, stat_buf) < 0 ) { in trim_device()
69 free(stat_buf); in trim_device()
78 if (S_ISREG(stat_buf->st_mode)) { in trim_device()
85 free(stat_buf); in trim_device()
87 } else if (S_ISBLK(stat_buf->st_mode)) { in trim_device()
89 free(stat_buf); in trim_device()
97 (unsigned long)stat_buf->st_size >> 20); in trim_device()
[all …]
/third_party/ltp/testcases/kernel/syscalls/fstat/
Dfstat02.c23 static struct stat stat_buf; variable
32 TEST(fstat(fildes, &stat_buf)); in run()
40 if (stat_buf.st_uid != user_id) { in run()
42 stat_buf.st_uid, user_id); in run()
46 if (stat_buf.st_gid != group_id) { in run()
48 stat_buf.st_gid, group_id); in run()
52 if (stat_buf.st_size != FILE_SIZE) { in run()
54 (long)stat_buf.st_size, FILE_SIZE); in run()
58 if ((stat_buf.st_mode & 0777) != FILE_MODE) { in run()
60 (stat_buf.st_mode & 0777), FILE_MODE); in run()
Dfstat03.c29 static struct stat stat_buf; variable
33 struct stat *stat_buf; member
36 {&fd_ebadf, &stat_buf, EBADF},
44 TEST(fstat(*tc->fd, tc->stat_buf)); in check_fstat()
/third_party/ltp/testcases/kernel/syscalls/lstat/
Dlstat01.c31 struct stat stat_buf; in run() local
33 memset(&stat_buf, 0, sizeof(stat_buf)); in run()
35 TEST(lstat(TESTSYML, &stat_buf)); in run()
39 if ((stat_buf.st_mode & S_IFMT) != S_IFLNK || in run()
40 stat_buf.st_uid != user_id || in run()
41 stat_buf.st_gid != group_id || in run()
42 stat_buf.st_size != strlen(TESTFILE)) { in run()
/third_party/mesa3d/src/drm-shim/
Ddrm_shim.c409 PUBLIC int stat(const char* path, struct stat* stat_buf) in stat() argument
417 return real_stat(path, stat_buf); in stat()
433 return real_stat(path, stat_buf); in stat()
435 memset(stat_buf, 0, sizeof(*stat_buf)); in stat()
436 stat_buf->st_rdev = makedev(DRM_MAJOR, render_node_minor); in stat()
437 stat_buf->st_mode = S_IFCHR; in stat()
442 PUBLIC int stat64(const char* path, struct stat64* stat_buf) in stat64() argument
450 return real_stat64(path, stat_buf); in stat64()
466 return real_stat64(path, stat_buf); in stat64()
468 memset(stat_buf, 0, sizeof(*stat_buf)); in stat64()
[all …]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/
D26-2.c41 struct stat stat_buf; in main() local
62 if (fstat(fd, &stat_buf) != 0) { in main()
67 old_uid = stat_buf.st_uid; in main()
68 old_gid = stat_buf.st_gid; in main()
104 if (fstat(fd, &stat_buf) != 0) { in main()
116 if (stat_buf.st_uid == old_uid && stat_buf.st_gid == old_gid) { in main()
121 if (stat_buf.st_uid != old_uid) in main()
123 if (stat_buf.st_gid != old_gid) in main()
D26-1.c33 struct stat stat_buf; in main() local
42 if (fstat(fd, &stat_buf) != 0) { in main()
47 old_mode = stat_buf.st_mode; in main()
56 if (fstat(fd, &stat_buf) != 0) { in main()
64 if (stat_buf.st_mode == old_mode) { in main()
/third_party/ltp/testcases/kernel/syscalls/chown/
Dchown02.c48 struct stat stat_buf; in run() local
49 SAFE_STAT(tc[i].filename, &stat_buf); in run()
51 if (stat_buf.st_uid != uid || stat_buf.st_gid != gid) { in run()
53 tc[i].filename, stat_buf.st_uid, stat_buf.st_gid, uid, gid); in run()
56 if (stat_buf.st_mode != tc[i].exp_mode) { in run()
58 tc[i].filename, stat_buf.st_mode, tc[i].exp_mode); in run()
Dchown03.c58 struct stat stat_buf; in run() local
59 SAFE_STAT(FILENAME, &stat_buf); in run()
60 check_owner(&stat_buf, uid, 0); in run()
61 check_mode(&stat_buf, NEW_PERMS); in run()
65 SAFE_STAT(FILENAME, &stat_buf); in run()
66 check_owner(&stat_buf, uid, gid); in run()
67 check_mode(&stat_buf, NEW_PERMS & ~(S_ISUID | S_ISGID)); in run()
Dchown05.c38 struct stat stat_buf; in run() local
45 SAFE_STAT(TESTFILE, &stat_buf); in run()
46 if (stat_buf.st_uid != expect_uid || stat_buf.st_gid != expect_gid) { in run()
/third_party/ltp/testcases/kernel/syscalls/fchown/
Dfchown02.c47 struct stat stat_buf; in run() local
59 SAFE_STAT(tc[i].filename, &stat_buf); in run()
61 if (stat_buf.st_uid != uid || stat_buf.st_gid != gid) in run()
63 tc[i].filename, stat_buf.st_uid, stat_buf.st_gid, uid, gid); in run()
65 if (stat_buf.st_mode != tc[i].exp_mode) in run()
67 tc[i].filename, stat_buf.st_mode, tc[i].exp_mode); in run()
Dfchown03.c55 struct stat stat_buf; in run() local
65 SAFE_STAT(FILENAME, &stat_buf); in run()
66 check_owner(&stat_buf, uid, 0); in run()
67 check_mode(&stat_buf, NEW_PERMS); in run()
70 SAFE_STAT(FILENAME, &stat_buf); in run()
71 check_owner(&stat_buf, uid, gid); in run()
72 check_mode(&stat_buf, NEW_PERMS & ~(S_ISUID | S_ISGID)); in run()
Dfchown05.c40 struct stat stat_buf; in run() local
47 SAFE_FSTAT(fd, &stat_buf); in run()
48 if (stat_buf.st_uid != expect_uid || stat_buf.st_gid != expect_gid) { in run()
/third_party/ltp/testcases/kernel/syscalls/chmod/
Dchmod01.c33 struct stat stat_buf; in verify_chmod() local
43 SAFE_STAT(tc->name, &stat_buf); in verify_chmod()
44 stat_buf.st_mode &= ~tc->mode_mask; in verify_chmod()
46 if (stat_buf.st_mode == (unsigned int)mode) { in verify_chmod()
48 tc->name, stat_buf.st_mode); in verify_chmod()
51 tc->name, stat_buf.st_mode); in verify_chmod()
Dchmod03.c39 struct stat stat_buf; in verify_chmod() local
48 SAFE_STAT(tc->name, &stat_buf); in verify_chmod()
50 if ((stat_buf.st_mode & PERMS) != PERMS) { in verify_chmod()
52 tc->name, stat_buf.st_mode); in verify_chmod()
55 tc->name, stat_buf.st_mode); in verify_chmod()
Dchmod07.c40 struct stat stat_buf; in test_chmod() local
52 if (stat(TESTFILE, &stat_buf) == -1) { in test_chmod()
57 if ((stat_buf.st_mode & PERMS) == PERMS) { in test_chmod()
62 TESTFILE, stat_buf.st_mode, PERMS); in test_chmod()
/third_party/ltp/testcases/kernel/syscalls/utime/
Dutime04.c99 struct stat stat_buf; /* struct buffer to hold file info. */ in main() local
126 SAFE_STAT(cleanup, TEMP_FILE, &stat_buf); in main()
127 modf_time = stat_buf.st_mtime; in main()
128 access_time = stat_buf.st_atime; in main()
Dutime05.c105 struct stat stat_buf; /* struct buffer to hold file info. */ in main() local
132 SAFE_STAT(cleanup, TEMP_FILE, &stat_buf); in main()
133 modf_time = stat_buf.st_mtime; in main()
134 access_time = stat_buf.st_atime; in main()
Dutime01.c98 struct stat stat_buf; /* struct buffer to hold file info. */ in main() local
152 SAFE_STAT(cleanup, TEMP_FILE, &stat_buf); in main()
153 modf_time = stat_buf.st_mtime; in main()
154 access_time = stat_buf.st_atime; in main()
Dutime02.c104 struct stat stat_buf; /* struct buffer to hold file info. */ in main() local
158 SAFE_STAT(cleanup, TEMP_FILE, &stat_buf); in main()
159 modf_time = stat_buf.st_mtime; in main()
160 access_time = stat_buf.st_atime; in main()
/third_party/ltp/testcases/kernel/syscalls/fsync/
Dfsync02.c32 struct statvfs stat_buf; variable
40 if (fstatvfs(fd, &stat_buf) != 0) { in setup()
44 f_bavail = (stat_buf.f_bavail * stat_buf.f_bsize) / BLOCKSIZE; in setup()
/third_party/ltp/testcases/kernel/syscalls/truncate/
Dtruncate02.c47 struct stat stat_buf; in verify_truncate() local
67 SAFE_STAT(TESTFILE, &stat_buf); in verify_truncate()
68 if (stat_buf.st_size != tc->trunc_len) { in verify_truncate()
70 TESTFILE, stat_buf.st_size, tc->trunc_len); in verify_truncate()
/third_party/ltp/testcases/kernel/syscalls/lchown/
Dlchown01.c74 struct stat stat_buf; in main() local
105 if (lstat(SFILE, &stat_buf) < 0) { in main()
131 if ((stat_buf.st_uid != user_id) || in main()
132 (stat_buf.st_gid != group_id)) { in main()

123