/external/f2fs-tools/mkfs/ |
D | f2fs_format_utils.c | 48 struct stat *stat_buf; in trim_device() local 53 stat_buf = malloc(sizeof(struct stat)); in trim_device() 54 if (fstat(fd, stat_buf) < 0 ) { in trim_device() 56 free(stat_buf); in trim_device() 65 if (S_ISREG(stat_buf->st_mode)) { in trim_device() 72 free(stat_buf); in trim_device() 74 } else if (S_ISBLK(stat_buf->st_mode)) { in trim_device() 76 free(stat_buf); in trim_device() 84 (unsigned long)stat_buf->st_size >> 20); in trim_device() 85 free(stat_buf); in trim_device() [all …]
|
/external/ltp/testcases/kernel/syscalls/stat/ |
D | stat01.c | 52 struct stat stat_buf; in verify() local 55 TEST(stat(TESTFILE, &stat_buf)); in verify() 62 if (stat_buf.st_uid != user_id) { in verify() 64 stat_buf.st_uid, user_id); in verify() 68 if (stat_buf.st_gid != group_id) { in verify() 70 stat_buf.st_gid, group_id); in verify() 74 if (stat_buf.st_size != FILE_SIZE) { in verify() 76 (long)stat_buf.st_size, FILE_SIZE); in verify() 80 if ((stat_buf.st_mode & MASK) != FILE_MODE) { in verify() 82 (stat_buf.st_mode & MASK), FILE_MODE); in verify()
|
D | stat02.c | 102 struct stat stat_buf; /* stat structure buffer */ in main() local 117 TEST(stat(TESTFILE, &stat_buf)); in main() 124 stat_buf.st_mode &= ~S_IFREG; in main() 129 if ((stat_buf.st_uid != user_id) || in main() 130 (stat_buf.st_gid != group_id) || in main() 131 (stat_buf.st_size != FILE_SIZE) || in main() 132 ((stat_buf.st_mode & MASK) != NEW_MODE)) { in main()
|
/external/ltp/testcases/kernel/syscalls/fstat/ |
D | fstat02.c | 52 struct stat stat_buf; in verify() local 55 TEST(fstat(fildes, &stat_buf)); in verify() 62 if (stat_buf.st_uid != user_id) { in verify() 64 stat_buf.st_uid, user_id); in verify() 68 if (stat_buf.st_gid != group_id) { in verify() 70 stat_buf.st_gid, group_id); in verify() 74 if (stat_buf.st_size != FILE_SIZE) { in verify() 76 (long)stat_buf.st_size, FILE_SIZE); in verify() 80 if ((stat_buf.st_mode & MASK) != FILE_MODE) { in verify() 82 (stat_buf.st_mode & MASK), FILE_MODE); in verify()
|
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/ |
D | 26-2.c | 42 struct stat stat_buf; in main() local 63 if (fstat(fd, &stat_buf) != 0) { in main() 68 old_uid = stat_buf.st_uid; in main() 69 old_gid = stat_buf.st_gid; in main() 104 if (fstat(fd, &stat_buf) != 0) { in main() 114 if (stat_buf.st_uid == old_uid && stat_buf.st_gid == old_gid) { in main() 119 if (stat_buf.st_uid != old_uid) in main() 121 if (stat_buf.st_gid != old_gid) in main()
|
D | 26-1.c | 33 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()
|
/external/ltp/testcases/kernel/syscalls/fchown/ |
D | fchown02.c | 72 struct stat stat_buf; in verify_fchown() local 81 SAFE_FSTAT(cleanup, *t->fd, &stat_buf); in verify_fchown() 83 if ((stat_buf.st_uid != t->user_id) || in verify_fchown() 84 (stat_buf.st_gid != t->group_id)) { in verify_fchown() 88 stat_buf.st_uid, stat_buf.st_gid); in verify_fchown() 93 if (((stat_buf.st_mode & (S_ISUID | S_ISGID)))) { in verify_fchown() 102 if ((!(stat_buf.st_mode & S_ISGID))) { in verify_fchown() 107 stat_buf.st_mode, NEW_PERMS2); in verify_fchown()
|
D | fchown03.c | 62 struct stat stat_buf; in main() local 85 SAFE_FSTAT(cleanup, fildes, &stat_buf); in main() 87 if ((stat_buf.st_uid != user_id) || in main() 88 (stat_buf.st_gid != group_id)) { in main() 95 if (stat_buf.st_mode != FCHOWN_PERMS) { in main() 98 stat_buf.st_mode, FCHOWN_PERMS); in main()
|
/external/ltp/testcases/kernel/syscalls/chown/ |
D | chown03.c | 101 struct stat stat_buf; /* stat(2) struct contents */ in main() local 125 if (stat(TESTFILE, &stat_buf) == -1) in main() 129 if (stat_buf.st_uid != user_id || in main() 130 stat_buf.st_gid != group_id) in main() 133 TESTFILE, stat_buf.st_uid, in main() 134 stat_buf.st_gid, user_id, group_id); in main() 136 if (stat_buf.st_mode != in main() 140 stat_buf.st_mode, in main()
|
D | chown02.c | 117 struct stat stat_buf; /* stat(2) struct contents */ in main() local 155 if (stat(file_name, &stat_buf) < 0) { in main() 165 if (stat_buf.st_uid != user_id || in main() 166 stat_buf.st_gid != group_id) { in main() 179 (stat_buf.st_mode & (S_ISUID | S_ISGID)) != 0) { in main() 186 && (stat_buf.st_mode & S_ISGID) == 0) { in main() 191 stat_buf.st_mode, NEW_PERMS2); in main()
|
D | chown05.c | 105 struct stat stat_buf; /* stat(2) struct contents */ in main() local 129 if (stat(TESTFILE, &stat_buf) == -1) in main() 136 if (stat_buf.st_uid != user_id || in main() 137 stat_buf.st_gid != group_id) in main()
|
/external/libchrome/base/test/ |
D | test_file_util_posix.cc | 28 struct stat stat_buf; in DenyFilePermission() local 29 if (stat(path.value().c_str(), &stat_buf) != 0) in DenyFilePermission() 31 stat_buf.st_mode &= ~permission; in DenyFilePermission() 33 int rv = HANDLE_EINTR(chmod(path.value().c_str(), stat_buf.st_mode)); in DenyFilePermission() 44 struct stat stat_buf; in GetPermissionInfo() local 45 if (stat(path.value().c_str(), &stat_buf) != 0) in GetPermissionInfo() 50 *mode = stat_buf.st_mode & ~S_IFMT; // Filter out file/path kind. in GetPermissionInfo()
|
/external/valgrind/coregrind/ |
D | m_commandline.c | 58 struct vg_stat stat_buf; in read_dot_valgrindrc() local 69 Int res = VG_(fstat)( sr_Res(fd), &stat_buf ); in read_dot_valgrindrc() 73 && stat_buf.uid == VG_(geteuid)() in read_dot_valgrindrc() 74 && VKI_S_ISREG(stat_buf.mode) in read_dot_valgrindrc() 75 && !(stat_buf.mode & VKI_S_IWOTH)) { in read_dot_valgrindrc() 76 if ( stat_buf.size > 0 ) { in read_dot_valgrindrc() 77 f_clo = VG_(malloc)("commandline.rdv.1", stat_buf.size+1); in read_dot_valgrindrc() 78 Int n = VG_(read)(sr_Res(fd), f_clo, stat_buf.size); in read_dot_valgrindrc() 80 vg_assert(n >= 0 && n <= stat_buf.size+1); in read_dot_valgrindrc()
|
/external/ltp/testcases/kernel/syscalls/lstat/ |
D | lstat03.c | 63 struct stat stat_buf; in main() local 73 TEST(lstat(SFILE, &stat_buf)); in main() 80 if ((stat_buf.st_uid != user_id) || in main() 81 (stat_buf.st_gid != group_id) || in main() 82 ((stat_buf.st_mode & S_IFMT) != S_IFLNK) || in main() 83 (stat_buf.st_size != strlen(TESTFILE))) { in main()
|
/external/ltp/testcases/kernel/syscalls/ftruncate/ |
D | ftruncate02.c | 97 struct stat stat_buf; /* stat(2) struct contents */ in main() local 129 if (fstat(fd, &stat_buf) < 0) { in main() 134 stat_buf.st_mode &= ~S_IFREG; in main() 135 file_length1 = stat_buf.st_size; in main() 163 if (fstat(fd, &stat_buf) < 0) { in main() 168 stat_buf.st_mode &= ~S_IFREG; in main() 169 file_length2 = stat_buf.st_size; in main()
|
D | ftruncate01.c | 95 struct stat stat_buf; /* stat(2) struct contents */ in main() local 122 if (fstat(fildes, &stat_buf) < 0) { in main() 127 stat_buf.st_mode &= ~S_IFREG; in main() 128 file_length = stat_buf.st_size; in main()
|
/external/ltp/testcases/kernel/syscalls/chmod/ |
D | chmod01.c | 94 struct stat stat_buf; in main() local 120 if (stat(TESTFILE, &stat_buf) < 0) in main() 123 stat_buf.st_mode &= ~S_IFREG; in main() 125 if (stat_buf.st_mode == mode) in main() 132 TESTFILE, stat_buf.st_mode, in main()
|
D | chmod07.c | 107 struct stat stat_buf; /* stat(2) struct contents */ in main() local 133 if (stat(TESTFILE, &stat_buf) == -1) in main() 138 if ((stat_buf.st_mode & PERMS) == PERMS) in main() 145 stat_buf.st_mode, PERMS); in main()
|
/external/ltp/testcases/kernel/syscalls/fchmod/ |
D | fchmod07.c | 93 struct stat stat_buf; /* stat(2) struct contents */ in main() local 127 if (fstat(fd, &stat_buf) < 0) { in main() 133 stat_buf.st_mode &= ~S_IFREG; in main() 139 if (stat_buf.st_mode == mode) { in main() 147 TESTFILE, stat_buf.st_mode, in main()
|
/external/ltp/testcases/kernel/syscalls/utime/ |
D | utime04.c | 99 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()
|
D | utime05.c | 105 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()
|
D | utime01.c | 98 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()
|
D | utime02.c | 104 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()
|
/external/libxkbcommon/xkbcommon/src/ |
D | utils.c | 37 struct stat stat_buf; in map_file() local 43 if (fstat(fd, &stat_buf) != 0) in map_file() 46 string = mmap(NULL, stat_buf.st_size, PROT_READ, MAP_SHARED, fd, 0); in map_file() 51 *size_out = stat_buf.st_size; in map_file()
|
/external/ltp/testcases/kernel/syscalls/truncate/ |
D | truncate02.c | 98 struct stat stat_buf; /* stat(2) struct contents */ in main() local 130 if (stat(TESTFILE, &stat_buf) < 0) { in main() 135 file_length1 = stat_buf.st_size; in main() 171 if (stat(TESTFILE, &stat_buf) < 0) { in main() 176 file_length2 = stat_buf.st_size; in main()
|