/third_party/ltp/testcases/kernel/syscalls/madvise/ |
D | madvise02.c | 94 if (mlock(file1, st.st_size) < 0) in tcases_filter() 149 file1 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); in setup() 150 file2 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); in setup() 151 file3 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in setup() 157 ptr_addr = SAFE_MALLOC(st.st_size); in setup() 161 SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize); in setup() 177 TEST(madvise(*(tc->addr), st.st_size, tc->advice)); in advice_test() 195 SAFE_MUNMAP(file1, st.st_size); in cleanup() 196 SAFE_MUNMAP(file2, st.st_size - pagesize); in cleanup() 197 SAFE_MUNMAP(file3, st.st_size); in cleanup()
|
D | madvise01.c | 78 sfile = SAFE_MMAP(NULL, st.st_size, in setup() 83 amem = SAFE_MMAP(NULL, st.st_size, in setup() 91 SAFE_MUNMAP(sfile, st.st_size); in cleanup() 92 SAFE_MUNMAP(amem, st.st_size); in cleanup() 100 TEST(madvise(*(tc->addr), st.st_size, tc->advice)); in verify_madvise()
|
/third_party/ltp/testcases/kernel/syscalls/sendfile/ |
D | sendfile06.c | 48 TEST(sendfile(out_fd, in_fd, NULL, sb.st_size)); in run() 51 if (sb.st_size != TST_RET) in run() 54 sb.st_size, TST_RET); in run() 55 else if (after_pos != sb.st_size) in run() 59 (int64_t)(sb.st_size), (int64_t)(after_pos)); in run()
|
/third_party/musl/libc-test/src/functionalext/supplement/mman/ |
D | mmap.c | 52 start = mmap(NULL, statbuff.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in mmap_0100() 56 mm = munmap(start, statbuff.st_size); in mmap_0100() 90 start = mmap(NULL, statbuff.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in mmap_0200() 94 mm = munmap(start, statbuff.st_size); in mmap_0200() 144 start = mmap(NULL, statbuff.st_size, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0); in mmap_0400() 147 mm = munmap(start, statbuff.st_size); in mmap_0400() 182 … start = mmap(NULL, statbuff.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_DENYWRITE, fd, 0); in mmap_0500() 185 mm = munmap(start, statbuff.st_size); in mmap_0500() 219 start = mmap(NULL, statbuff.st_size, PROT_NONE, MAP_PRIVATE | MAP_FIXED, -1, 0); in mmap_0600() 255 start = mmap(NULL, statbuff.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, OFF_MASK); in mmap_0700() [all …]
|
/third_party/libpsl/fuzz/ |
D | main.c | 83 data = malloc(st.st_size); in test_all_from() 84 if ((n = read(fd, data, st.st_size)) == st.st_size) { in test_all_from() 86 LLVMFuzzerTestOneInput(data, st.st_size); in test_all_from() 88 …fprintf(stderr, "Failed to read %d bytes from %s (%d), got %d\n", (int) st.st_size, fname, errno, … in test_all_from()
|
/third_party/libwebsockets/lib/misc/lwsac/ |
D | cached-file.c | 180 all = sizeof(*info) + (unsigned long)s.st_size + 2; in lwsac_cached_file() 191 *len = (unsigned long)s.st_size; in lwsac_cached_file() 192 a[s.st_size] = '\0'; in lwsac_cached_file() 194 rd = read(fd, a, (unsigned long)s.st_size); in lwsac_cached_file() 195 if (rd != s.st_size) { in lwsac_cached_file()
|
/third_party/ltp/testcases/kernel/syscalls/splice/ |
D | splice02.c | 76 if (st.st_size != file_size) { in do_child() 78 st.st_size, file_size); in do_child() 89 blocks = LTP_ALIGN(st.st_size, page_size) / page_size; in do_child() 95 to_check = (block+1) * page_size < (unsigned long)st.st_size ? in do_child() 96 page_size : st.st_size % page_size; in do_child()
|
/third_party/libsnd/tests/ |
D | win32_test.c | 109 if (sizeof (statbuf.st_size) != sizeof (INT64)) in show_fstat_error() 153 printf ("4) According to fstat(), the file length is %ld, ", (long) statbuf.st_size) ; in show_fstat_error() 157 if (statbuf.st_size != 2 * sizeof (data)) in show_fstat_error() 253 stat_size = buf.st_size ; in show_stat_fstat_error() 259 fstat_size = buf.st_size ; in show_stat_fstat_error() 303 printf (" File size is %d bytes.\n", (int) buf.st_size) ; in write_to_closed_file() 312 printf (" File size is %d bytes.\n", (int) buf.st_size) ; in write_to_closed_file()
|
/third_party/ltp/testcases/kernel/syscalls/write/ |
D | write06.c | 46 if (statbuf.st_size != K2) in verify_write() 47 tst_res(TFAIL, "file size is %ld != K2", statbuf.st_size); in verify_write() 62 if (statbuf.st_size != K3) in verify_write() 63 tst_res(TFAIL, "Wrong file size after append %zu expected %u", statbuf.st_size, K3); in verify_write()
|
/third_party/ltp/testcases/kernel/syscalls/pwrite/ |
D | pwrite04.c | 54 if (statbuf.st_size != K2) in verify_pwrite() 55 tst_res(TFAIL, "file size is %ld != K2", statbuf.st_size); in verify_pwrite() 62 if (statbuf.st_size != K3) in verify_pwrite() 63 tst_res(TFAIL, "file size is %ld != K3", statbuf.st_size); in verify_pwrite()
|
/third_party/flutter/engine/flutter/third_party/txt/tests/ |
D | FileUtils.cpp | 31 std::vector<uint8_t> result(st.st_size); in readWholeFile() 32 LOG_ALWAYS_FATAL_IF(fread(result.data(), 1, st.st_size, fp) != in readWholeFile() 33 static_cast<size_t>(st.st_size)); in readWholeFile()
|
/third_party/skia/third_party/externals/libjpeg-turbo/md5/ |
D | md5hl.c | 101 if (ofs > stbuf.st_size) in MD5FileChunk() 102 ofs = stbuf.st_size; in MD5FileChunk() 103 if ((len == 0) || (len > stbuf.st_size - ofs)) in MD5FileChunk() 104 len = stbuf.st_size - ofs; in MD5FileChunk()
|
/third_party/libjpeg-turbo/md5/ |
D | md5hl.c | 101 if (ofs > stbuf.st_size) in MD5FileChunk() 102 ofs = stbuf.st_size; in MD5FileChunk() 103 if ((len == 0) || (len > stbuf.st_size - ofs)) in MD5FileChunk() 104 len = stbuf.st_size - ofs; in MD5FileChunk()
|
/third_party/ltp/testcases/kernel/syscalls/init_module/ |
D | init_module01.c | 33 buf = SAFE_MMAP(0, sb.st_size, PROT_READ|PROT_EXEC, MAP_PRIVATE, fd, 0); in setup() 39 TST_EXP_PASS(init_module(buf, sb.st_size, "status=valid")); in run() 48 munmap(buf, sb.st_size); in cleanup()
|
/third_party/flutter/skia/third_party/externals/libjpeg-turbo/md5/ |
D | md5hl.c | 101 if (ofs > stbuf.st_size) in MD5FileChunk() 102 ofs = stbuf.st_size; in MD5FileChunk() 103 if ((len == 0) || (len > stbuf.st_size - ofs)) in MD5FileChunk() 104 len = stbuf.st_size - ofs; in MD5FileChunk()
|
/third_party/node/test/wasi/c/ |
D | ftruncate.c | 22 assert(st.st_size == 0); in main() 28 assert(st.st_size == 500); in main() 34 assert(st.st_size == 300); in main()
|
/third_party/toybox/toys/posix/ |
D | cpio.c | 234 && st.st_size && (fd = open(name, O_RDONLY))<0)) in cpio_main() 240 if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) st.st_size = 0; in cpio_main() 241 if (st.st_size >> 32) perror_msg("skipping >2G file '%s'", name); in cpio_main() 246 (int)st.st_mtime, (int)st.st_size, dev_major(st.st_dev), in cpio_main() 257 llen = st.st_size; in cpio_main() 270 llen = st.st_size & 3; in cpio_main()
|
/third_party/glib/glib/ |
D | gmappedfile.c | 143 if (st.st_size == 0 && S_ISREG (st.st_mode)) in mapped_file_new_from_fd() 153 if (sizeof (st.st_size) > sizeof (gsize) && st.st_size > (off_t) G_MAXSIZE) in mapped_file_new_from_fd() 159 file->length = (gsize) st.st_size; in mapped_file_new_from_fd() 166 file->length = st.st_size; in mapped_file_new_from_fd()
|
/third_party/flutter/engine/flutter/fml/platform/posix/ |
D | mapping_posix.cc | 66 if (stat_buffer.st_size == 0) { in FileMapping() 74 ::mmap(nullptr, stat_buffer.st_size, ToPosixProtectionFlags(protection), in FileMapping() 82 size_ = stat_buffer.st_size; in FileMapping()
|
/third_party/toybox/toys/pending/ |
D | more.c | 116 st.st_size = show_prompt = col = row = 0; in more_main() 136 if (st.st_size) in more_main() 138 (int) (100 * ( (double) ftell(fp) / (double) st.st_size)), in more_main() 139 (long long)st.st_size); in more_main()
|
/third_party/openssl/fuzz/ |
D | test-corpus.c | 51 buf = malloc(st.st_size); in testfile() 53 s = fread(buf, 1, st.st_size, f); in testfile() 54 OPENSSL_assert(s == (size_t)st.st_size); in testfile()
|
/third_party/musl/libc-test/src/functionalext/supplement/unistd/ |
D | readlink.c | 32 buf = malloc(sb.st_size + 1); in readlink_0100() 65 buf = malloc(sb.st_size + 1); in readlink_0200() 96 buf = malloc(sb.st_size + 1); in readlink_0300()
|
D | ftruncate.c | 40 EXPECT_EQ("ftruncate_0100", statbuff.st_size, FILE_ZERO); in ftruncate_0100() 62 EXPECT_EQ("ftruncate_0200", (int)statbuff.st_size, FILE_FIRST); in ftruncate_0200() 83 EXPECT_EQ("ftruncate_0300", (int)statbuff.st_size, FILE_SECOND); in ftruncate_0300()
|
/third_party/e2fsprogs/util/ |
D | copy_sparse.c | 126 numblocks = (fileinfo.st_size + (bs-1)) / bs; in copy_sparse_file() 129 (long long) fileinfo.st_size, numblocks); in copy_sparse_file() 189 offset = fileinfo.st_size; in copy_sparse_file() 194 if (fileinfo.st_size != offset) { in copy_sparse_file()
|
/third_party/ltp/testcases/kernel/mem/mmapstress/ |
D | mmapstress10.c | 576 filesize = statbuf.st_size; 578 if (statbuf.st_size - sparseoffset > SIZE_MAX) { 582 mapsize_mapper = (size_t) (statbuf.st_size - sparseoffset); 743 growsize, off, statbuf.st_size); 747 growsize, off, statbuf.st_size); 827 if (statbuf.st_size - sparseoffset > SIZE_MAX) { 831 mapsize = (size_t) (statbuf.st_size - sparseoffset); 864 statbuf.st_size); 868 statbuf.st_size);
|