From 3fd68a6a044e674d434353d5631aba2743e0bf89 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 2 Feb 2005 22:42:06 +0000 Subject: * fhandler.h (fhandler_base::ftruncate): Define new virtual method. (fhandler_disk_file::ftruncate): Ditto. * fhandler.cc (fhandler_base::ftruncate): New method. * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto. * syscalls.cc (ftruncate64): Move functionality into fhandlers. Call fhandler method from here. --- winsup/cygwin/fhandler.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 5f60d0eb2..aa996ea56 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1,6 +1,7 @@ /* fhandler.cc. See console.cc for fhandler_console functions. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Red Hat, Inc. This file is part of Cygwin. @@ -814,8 +815,8 @@ fhandler_base::write (const void *ptr, size_t len) HANDLE h = get_output_handle (); BOOL r = DeviceIoControl (h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dw, NULL); - syscall_printf ("%d = DeviceIoControl(%p, FSCTL_SET_SPARSE, " - "NULL, 0, NULL, 0, &dw, NULL)", r, h); + syscall_printf ("%d = DeviceIoControl(%p, FSCTL_SET_SPARSE)", + r, h); } else if (wincap.has_lseek_bug ()) { @@ -1595,3 +1596,10 @@ fhandler_base::facl (int cmd, int nentries, __aclent32_t *aclbufp) } return res; } + +int +fhandler_base::ftruncate (_off64_t length) +{ + set_errno (EINVAL); + return -1; +} -- cgit v1.2.3