Home
last modified time | relevance | path

Searched refs:file_size (Results 1 – 25 of 192) sorted by relevance

12345678

/third_party/alsa-utils/alsamixer/
Dutils.c119 char *read_file(const char *file_name, unsigned int *file_size) in read_file() argument
133 *file_size = 0; in read_file()
138 bytes_read = fread(buf + *file_size, 1, allocated - *file_size, f); in read_file()
139 *file_size += bytes_read; in read_file()
140 } while (*file_size == allocated && allocated < MAX_FILE_SIZE); in read_file()
142 if (*file_size > 0 && buf[*file_size - 1] != '\n' && *file_size < allocated) { in read_file()
143 buf[*file_size] = '\n'; in read_file()
144 ++*file_size; in read_file()
/third_party/ltp/testcases/kernel/mce-test/tsrc/
Dthugetlb.c45 int file_size; /* Memory allocation size (hugepage unit) */ variable
135 file_size = 1; in main()
147 file_size = strtol(optarg, NULL, 10); in main()
192 if (inject && corrupt_page * PS > file_size * HPAGE_SIZE) in main()
208 addr = alloc_shm_hugepage(&shmkey, file_size * HPAGE_SIZE); in main()
212 addr = alloc_anonymous_hugepage(file_size * HPAGE_SIZE, in main()
218 file_size * HPAGE_SIZE, in main()
244 write_hugepage(addr, file_size, 0); in main()
245 read_hugepage(addr, file_size, 0); in main()
262 write_hugepage(addr, file_size, 0); in main()
[all …]
/third_party/fsverity-utils/programs/
Dtest_compute_digest.c52 u64 file_size; member
57 .file_size = 1000000,
65 .file_size = 100000,
73 .file_size = 4096,
81 .file_size = 1,
89 .file_size = 0,
97 .file_size = 1000000,
106 .file_size = 1000000,
115 .file_size = 1000000,
123 .file_size = 1000000,
[all …]
Dcmd_enable.c22 u64 file_size; in read_signature() local
28 if (!get_file_size(&file, &file_size)) in read_signature()
30 if (file_size <= 0) { in read_signature()
34 if (file_size > 1000000) { in read_signature()
38 sig = xmalloc(file_size); in read_signature()
39 if (!full_read(&file, sig, file_size)) in read_signature()
42 *sig_size_ret = file_size; in read_signature()
/third_party/ffmpeg/libavformat/
Drsoenc.c70 int64_t file_size; in rso_write_trailer() local
73 file_size = avio_tell(pb); in rso_write_trailer()
75 if (file_size < 0) in rso_write_trailer()
76 return file_size; in rso_write_trailer()
78 if (file_size > 0xffff + RSO_HEADER_SIZE) { in rso_write_trailer()
80 "Output file is too big (%"PRId64" bytes >= 64kB)\n", file_size); in rso_write_trailer()
83 coded_file_size = file_size - RSO_HEADER_SIZE; in rso_write_trailer()
89 avio_seek(pb, file_size, SEEK_SET); in rso_write_trailer()
Dmca.c48 int64_t file_size = avio_size(s->pb); in read_header() local
106 if (file_size < 0) { in read_header()
109 if (file_size - data_size > UINT32_MAX) in read_header()
111 m->data_start = file_size - data_size; in read_header()
126 if (file_size > 0 && (int64_t)m->data_start + data_size > file_size) { in read_header()
128 if ((int64_t)header_size + data_size > file_size) { in read_header()
137 if (file_size - data_offset > UINT32_MAX) in read_header()
139 m->data_start = file_size - data_size; in read_header()
Dwavenc.c412 int64_t file_size, data_size; in wav_write_trailer() local
427 file_size = avio_tell(pb); in wav_write_trailer()
428 data_size = file_size - wav->data; in wav_write_trailer()
429 if (wav->rf64 == RF64_ALWAYS || (wav->rf64 == RF64_AUTO && file_size - 8 > UINT32_MAX)) { in wav_write_trailer()
431 } else if (file_size - 8 <= UINT32_MAX) { in wav_write_trailer()
433 avio_wl32(pb, (uint32_t)(file_size - 8)); in wav_write_trailer()
434 avio_seek(pb, file_size, SEEK_SET); in wav_write_trailer()
438 file_size); in wav_write_trailer()
452 avio_seek(pb, file_size, SEEK_SET); in wav_write_trailer()
466 avio_wl64(pb, file_size - 8); /* RF64 chunk size */ in wav_write_trailer()
[all …]
Dapm.c51 uint32_t file_size; member
64 ext->file_size = AV_RL32(buf + 4); in apm_parse_extradata()
287 int64_t file_size, data_size; in apm_write_trailer() local
289 file_size = avio_tell(s->pb); in apm_write_trailer()
290 data_size = file_size - (APM_FILE_HEADER_SIZE + APM_FILE_EXTRADATA_SIZE); in apm_write_trailer()
292 if (file_size >= UINT32_MAX) { in apm_write_trailer()
295 file_size); in apm_write_trailer()
300 avio_wl32(s->pb, (uint32_t)file_size); in apm_write_trailer()
Dapetag.c121 int64_t file_size = avio_size(pb); in ff_ape_parse_tag() local
127 if (file_size < APE_TAG_FOOTER_BYTES) in ff_ape_parse_tag()
130 avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET); in ff_ape_parse_tag()
149 if (tag_bytes > file_size - APE_TAG_FOOTER_BYTES) { in ff_ape_parse_tag()
166 avio_seek(pb, file_size - tag_bytes, SEEK_SET); in ff_ape_parse_tag()
171 tag_start = file_size - tag_bytes; in ff_ape_parse_tag()
Dkvag.c179 int64_t file_size, data_size; in kvag_write_trailer() local
181 file_size = avio_tell(s->pb); in kvag_write_trailer()
182 data_size = file_size - KVAG_HEADER_SIZE; in kvag_write_trailer()
186 avio_seek(s->pb, file_size, SEEK_SET); in kvag_write_trailer()
190 file_size); in kvag_write_trailer()
Daiffenc.c239 int64_t file_size, end_size; in aiff_write_trailer() local
240 end_size = file_size = avio_tell(pb); in aiff_write_trailer()
241 if (file_size & 1) { in aiff_write_trailer()
249 avio_wb32(pb, (file_size - aiff->ssnd - 12) / par->block_align); in aiff_write_trailer()
253 avio_wb32(pb, file_size - aiff->ssnd - 4); in aiff_write_trailer()
264 file_size = avio_tell(pb); in aiff_write_trailer()
266 avio_wb32(pb, file_size - aiff->form - 4); in aiff_write_trailer()
/third_party/ltp/testcases/kernel/syscalls/splice/
Dsplice02.c41 static int file_size; variable
46 if (tst_parse_int(sarg, &file_size, 1, INT_MAX)) in setup()
76 if (st.st_size != file_size) { in do_child()
78 st.st_size, file_size); in do_child()
125 if (!file_size) { in run()
127 file_size = max_pipe_size << 4; in run()
130 to_write = file_size; in run()
135 tst_res(TINFO, "writting %d bytes", file_size); in run()
141 buf[i] = get_letter(file_size - to_write + i); in run()
/third_party/ltp/testcases/kernel/fs/fsx-linux/
Dfsx-linux.c101 off_t file_size = 0; variable
316 save_buffer(good_buf, file_size, fsxgoodfd); in report_failure()
483 if (file_size != statbuf.st_size || file_size != size_by_seek) { in check_size()
485 (unsigned long long)file_size, in check_size()
600 if (size + offset > file_size) { in doread()
655 if (size + offset > file_size) { in domapread()
734 log4(OP_WRITE, offset, size, file_size, &t); in dowrite()
737 if (file_size < offset + size) { in dowrite()
738 if (file_size < offset) in dowrite()
739 memset(good_buf + file_size, '\0', offset - file_size); in dowrite()
[all …]
/third_party/node/deps/v8/tools/
Dshell-utils.h49 int file_size = static_cast<int>(ftell(file)); in ReadFileAndRepeat() local
52 *size = file_size * repeat; in ReadFileAndRepeat()
55 for (int i = 0; i < file_size;) { in ReadFileAndRepeat()
56 int read = static_cast<int>(fread(&chars[i], 1, file_size - i, file)); in ReadFileAndRepeat()
61 for (int i = file_size; i < *size; i++) { in ReadFileAndRepeat()
62 chars[i] = chars[i - file_size]; in ReadFileAndRepeat()
/third_party/skia/third_party/externals/libwebp/imageio/
Dimageio_util.c75 size_t file_size; in ImgIoUtilReadFile() local
91 file_size = ftell(in); in ImgIoUtilReadFile()
94 file_data = (uint8_t*)WebPMalloc(file_size + 1); in ImgIoUtilReadFile()
101 ok = (fread(file_data, file_size, 1, in) == 1); in ImgIoUtilReadFile()
106 (int)file_size, (const W_CHAR*)file_name); in ImgIoUtilReadFile()
110 file_data[file_size] = '\0'; // convenient 0-terminator in ImgIoUtilReadFile()
112 *data_size = file_size; in ImgIoUtilReadFile()
/third_party/skia/third_party/externals/tint/fuzzers/
Dtint_black_box_fuzz_target.cc65 const auto file_size = static_cast<size_t>(tell_file_size); in ReadFile() local
66 if (0 != (file_size % sizeof(T))) { in ReadFile()
69 << file_size << " bytes in the file, require " << sizeof(T) in ReadFile()
77 buffer->resize(file_size / sizeof(T)); in ReadFile()
79 size_t bytes_read = fread(buffer->data(), 1, file_size, file); in ReadFile()
81 if (bytes_read != file_size) { in ReadFile()
/third_party/mesa3d/src/microsoft/spirv_to_dxil/
Dspirv2dxil.c121 size_t file_size; in main() local
122 char *file_contents = os_read_file(filename, &file_size); in main()
128 if (file_size % WORD_SIZE != 0) { in main()
130 file_size, WORD_SIZE); in main()
134 size_t word_count = file_size / WORD_SIZE; in main()
/third_party/ltp/testcases/kernel/mem/mtest06/
Dmmap1.c43 static int file_size = 1024; variable
103 (size_t) file_size, PROT_WRITE | PROT_READ, in map_write_unmap()
107 for (j = 0; j < file_size; j++) in map_write_unmap()
112 SAFE_MUNMAP(tmp, file_size); in map_write_unmap()
130 for (j = 0; j < file_size; j++) { in read_mem()
229 int fd = mkfile(file_size); in run()
/third_party/selinux/secilc/
Dsecil2conf.c69 uint32_t file_size; in main() local
152 file_size = filedata.st_size; in main()
154 buffer = malloc(file_size); in main()
155 rc = fread(buffer, file_size, 1, file); in main()
163 rc = cil_add_file(db, argv[i], buffer, file_size); in main()
Dsecil2tree.c73 uint32_t file_size; in main() local
158 file_size = filedata.st_size; in main()
160 buffer = malloc(file_size); in main()
161 rc = fread(buffer, file_size, 1, file); in main()
169 rc = cil_add_file(db, argv[i], buffer, file_size); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/
D9-1.c77 int file_size = num_aiocbs * buf_size; in do_test() local
79 bufs = malloc(file_size); in do_test()
86 ret = write(fd, bufs, file_size); in do_test()
87 if (ret != file_size) { in do_test()
93 ret, file_size); in do_test()
/third_party/skia/third_party/externals/sfntly/cpp/src/sample/chromium/
Dchrome_subsetter.cc54 size_t file_size = ftell(input_file); in LoadFile() local
56 input_buffer->resize(file_size); in LoadFile()
57 size_t bytes_read = fread(&((*input_buffer)[0]), 1, file_size, input_file); in LoadFile()
59 return bytes_read == file_size; in LoadFile()
/third_party/fsverity-utils/lib/
Dcompute_digest.c104 u64 file_size, struct hash_ctx *hash, in compute_root_hash() argument
122 if (file_size == 0) { in compute_root_hash()
135 blocks = DIV_ROUND_UP(file_size, block_size); in compute_root_hash()
183 for (offset = 0; offset < file_size; offset += block_size) { in compute_root_hash()
184 buffers[-1].filled = min(block_size, file_size - offset); in compute_root_hash()
302 desc.data_size = cpu_to_le64(params->file_size); in libfsverity_compute_digest()
308 err = compute_root_hash(fd, read_fn, params->file_size, hash, in libfsverity_compute_digest()
/third_party/skia/third_party/externals/sfntly/cpp/src/test/
Dtest_font_utils.cc75 size_t file_size = ftell(input_file); in LoadFile() local
77 input_buffer->resize(file_size); in LoadFile()
78 size_t bytes_read = fread(&((*input_buffer)[0]), 1, file_size, input_file); in LoadFile()
79 EXPECT_EQ(bytes_read, file_size); in LoadFile()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/munmap/
D9-1.c33 long file_size; in main() local
46 file_size = 2 * page_size; in main()
61 if (ftruncate(fd, file_size) == -1) { in main()

12345678