Home
last modified time | relevance | path

Searched refs:ftruncate (Results 1 - 25 of 168) sorted by relevance

1234567

/third_party/musl/libc-test/src/functionalext/supplement/unistd/
H A Dftruncate.c37 int freturn = ftruncate(fileno(fptr), 0); in ftruncate_0100()
59 int freturn = ftruncate(fileno(fptr), 10); in ftruncate_0200()
80 int freturn = ftruncate(fileno(fptr), 100); in ftruncate_0300()
100 int freturn = ftruncate(0, 10); in ftruncate_0400()
/third_party/node/test/parallel/
H A Dtest-fs-truncate.js37 ' Please use fs.ftruncate with a file descriptor instead.';
114 fs.ftruncate(fd, 1024, function(er) {
120 fs.ftruncate(fd, function(er) {
167 fs.ftruncate(fd, 4, common.mustSucceed(() => {
190 () => fs.ftruncate(fd, input),
211 () => fs.ftruncate(fd, input),
221 fs.ftruncate(fd, undefined, common.mustSucceed(() => {
231 fs.ftruncate(fd, -1, common.mustSucceed(() => {
271 ['ftruncate', 'ftruncateSync'].forEach((fnName) => {
H A Dtest-trace-events-fs-async.js107 function ftruncate() { function
111 fs.ftruncate(fd, 1, () => {
280 tests.ftruncate = wrapper(ftruncate);
/third_party/rust/crates/rustix/tests/io/
H A Dseals.rs5 fcntl_add_seals, fcntl_get_seals, ftruncate, memfd_create, MemfdFlags, SealFlags, in test_seals()
31 ftruncate(&mut file, 1).unwrap(); in test_seals()
39 ftruncate(&mut file, 0).unwrap_err(); in test_seals()
/third_party/musl/src/unistd/
H A Dftruncate.c4 int ftruncate(int fd, off_t length) in ftruncate() function
9 weak_alias(ftruncate, ftruncate64);
/third_party/curl/src/
H A Dtool_cb_see.h32 #undef ftruncate macro
33 #define ftruncate(fd,where) tool_ftruncate64(fd,where) macro
/third_party/node/test/wasi/c/
H A Dftruncate.c25 /* Increase the file size using ftruncate(). */ in main()
26 assert(0 == ftruncate(fd, 500)); in main()
31 /* Truncate the file using ftruncate(). */ in main()
32 assert(0 == ftruncate(fd, 300)); in main()
/third_party/NuttX/fs/vfs/
H A Dfs_truncate.c39 * Equivalent to the standard ftruncate() function except that is accepts
89 * Name: ftruncate
92 * The ftruncate() function causes the regular file referenced by fd to
99 * references a shared memory object, ftruncate() sets the size of the
103 * With ftruncate(), the file must be open for writing; for truncate(),
106 * ftruncate() does not modify the file offset for any open file
121 int ftruncate(int fd, off_t length) in ftruncate() function
174 ret = ftruncate(fd, length); in truncate()
/third_party/ltp/testcases/kernel/syscalls/mmap/
H A Dmmap09.c24 * ftruncate should be allowed to increase, decrease, or zero the
28 * Use ftruncate to shrink the file while it is mapped
29 * Use ftruncate to grow the file while it is mapped
30 * Use ftruncate to zero the size of the file while it is mapped
55 {mapsize - 8192, "ftruncate mmaped file to a smaller size"},
56 {mapsize + 1024, "ftruncate mmaped file to a larger size"},
57 {0, "ftruncate mmaped file to 0 size"},
75 TEST(ftruncate(fd, TC[i].newsize)); in main()
101 /* ftruncate the file to 16k */ in setup()
102 if (ftruncate(f in setup()
[all...]
/third_party/ltp/testcases/kernel/syscalls/ftruncate/
H A Dftruncate01.c9 * Verify that, ftruncate() succeeds to truncate a file to a certain length,
10 * if the file previously is smaller than the truncated size, ftruncate()
43 tst_res(TFAIL, "ftruncate() got incorrected size: %d", in check_and_report()
54 "ftruncate() got incorrect data %i, expected %i", in check_and_report()
60 tst_res(TPASS, "ftruncate() succeeded"); in check_and_report()
66 TEST(ftruncate(fd, TRUNC_LEN1)); in verify_ftruncate()
68 tst_res(TFAIL | TTERRNO, "ftruncate() failed"); in verify_ftruncate()
75 TEST(ftruncate(fd, TRUNC_LEN2)); in verify_ftruncate()
77 tst_res(TFAIL | TTERRNO, "ftruncate() failed"); in verify_ftruncate()
H A Dftruncate04.c17 * Parent checks that ftruncate before the locked region and inside the region
18 * fails while ftruncate after the region succeds.
22 * Parent checks that ftruncate now works in all cases.
46 TEST(ftruncate(fd, offset)); in ftruncate_expect_fail()
49 tst_res(TFAIL, "ftruncate() %s succeeded unexpectedly", msg); in ftruncate_expect_fail()
55 "ftruncate() %s failed unexpectedly, expected EAGAIN", in ftruncate_expect_fail()
60 tst_res(TPASS, "ftruncate() %s failed with EAGAIN", msg); in ftruncate_expect_fail()
67 TEST(ftruncate(fd, offset)); in ftruncate_expect_success()
71 "ftruncate() %s failed unexpectedly", msg); in ftruncate_expect_success()
79 "ftruncate() t in ftruncate_expect_success()
[all...]
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/fork/
H A D16-1.c82 ret = ftruncate(fd_s, sysconf(_SC_PAGESIZE)); in main()
88 ret = ftruncate(fd_ns, sysconf(_SC_PAGESIZE)); in main()
/third_party/pulseaudio/src/tests/
H A Dsigbus-test.c44 fail_unless(ftruncate(fd, page_size) >= 0); in START_TEST()
59 fail_unless(ftruncate(fd, 0) >= 0); in START_TEST()
/third_party/ltp/testcases/kernel/security/tomoyo/
H A Dtomoyo_rewrite_test.c106 show_prompt("ftruncate()"); in stage_rewrite_test()
107 show_result(ftruncate(fd, 0)); in stage_rewrite_test()
150 show_prompt("ftruncate()"); in stage_rewrite_test()
151 show_result(ftruncate(fd, 0)); in stage_rewrite_test()
/third_party/elfutils/libelf/
H A Delf_update.c62 && unlikely (ftruncate (elf->fildes, size) != 0)) in write_file()
82 really there. Only using ftruncate might mean the file is in write_file()
142 && unlikely (ftruncate (elf->fildes, size) != 0)) in write_file()
148 /* POSIX says that ftruncate and write may clear the S_ISUID and S_ISGID in write_file()
/third_party/ltp/testcases/open_posix_testsuite/conformance/definitions/unistd_h/
H A D2-1-buildonly.c11 * int ftruncate(int fildes, off_t length);
22 dummyvar = ftruncate; in dummyfcn()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/
H A D20-1.c13 * The test use ftruncate to check the object is not open for writing.
45 result = ftruncate(fd, BUF_SIZE); in main()
57 perror("ftruncate"); in main()
H A D20-2.c13 * The test use ftruncate to check the object is open for writing.
45 result = ftruncate(fd, BUF_SIZE); in main()
56 perror("ftruncate"); in main()
H A D13-1.c13 * The test uses ftruncate to check that the file is not open for write access.
37 result = ftruncate(fd, BUF_SIZE); in main()
49 perror("ftruncate"); in main()
H A D25-1.c41 if (ftruncate(fd, SHM_SZ) == -1) { in main()
42 perror("An error occurs when calling ftruncate()"); in main()
H A D20-3.c46 if (ftruncate(fd, BUF_SIZE) != 0) { in main()
47 perror("An error occurs when calling ftruncate()"); in main()
H A D14-2.c45 if (ftruncate(fd, BUF_SIZE) != 0) { in main()
46 perror("An error occurs when calling ftruncate()"); in main()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/
H A D3-1.c37 if (ftruncate(fd, BUF_SIZE) != 0) { in main()
38 perror("An error occurs when calling ftruncate()"); in main()
/third_party/rust/crates/rustix/src/fs/
H A Dfd.rs327 /// `ftruncate(fd, length)`—Sets the length of a file.
333 /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
334 /// [Linux]: https://man7.org/linux/man-pages/man2/ftruncate.2.html
336 pub fn ftruncate<Fd: AsFd>(fd: Fd, length: u64) -> io::Result<()> { in ftruncate() functions
337 backend::fs::syscalls::ftruncate(fd.as_fd(), length) in ftruncate()
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/
H A D21-1.c49 if (ftruncate(fd, size) == -1) { in main()
50 printf("Error at ftruncate(): %s\n", strerror(errno)); in main()

Completed in 6 milliseconds

1234567