* 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.
This commit is contained in:
Corinna Vinschen
2005-02-02 22:42:06 +00:00
parent 7823d9bb14
commit 3fd68a6a04
5 changed files with 77 additions and 34 deletions

View File

@ -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;
}