Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-11-26 14:50:38 +0300
committerCorinna Vinschen <corinna@vinschen.de>2023-11-28 12:52:05 +0300
commitf3554bf8905bfca5fbe54e57a452196bd9499cea (patch)
tree5128ef49bcf8d667c66b6cb721904a6aff30a3a9 /winsup/cygwin/syscalls.cc
parentfedd7fae77303ee3caf7c87510a03a9157deb06f (diff)
Cygwin: fhandler: rename ftruncate method to fallocate
also, take mode flags parameter instead of just a bool. Introduce __FALLOC_FL_TRUNCATE mode flag as internal flag to indictae being called from ftruncate(2). This is in preparation of an upcoming change introducing the Linx-specific fallocate(2) call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index c3c17d604..b2e6ba16c 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -2997,7 +2997,7 @@ posix_fallocate (int fd, off_t offset, off_t len)
{
cygheap_fdget cfd (fd);
if (cfd >= 0)
- res = cfd->ftruncate (offset + len, false);
+ res = cfd->fallocate (0, offset, len);
else
res = EBADF;
if (res == EISDIR)
@@ -3014,7 +3014,7 @@ ftruncate (int fd, off_t length)
cygheap_fdget cfd (fd);
if (cfd >= 0)
{
- res = cfd->ftruncate (length, true);
+ res = cfd->fallocate (__FALLOC_FL_TRUNCATE, 0, length);
if (res)
{
if (res == ENODEV)