* fhandler.cc (is_at_eof): Rewrite using NT functions.
(off_current): New static variable. (off_append): Ditto. (fhandler_base::raw_write): Use NtWriteFile. Accommodate O_APPEND here. (fhandler_base::write): Drop O_APPEND hack. Use NT functions. (fhandler_base::lseek): Rewrite using NT functions. * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Add space in debug output. (fhandler_disk_file::ftruncate): Ditto. * ntdll.h (STATUS_DISK_FULL): Define. (FILE_USE_FILE_POINTER_POSITION): Define. (FILE_WRITE_TO_END_OF_FILE): Define.
This commit is contained in:
@ -698,7 +698,7 @@ fhandler_disk_file::fstatvfs (struct statvfs *sfs)
|
||||
FSCTL_GET_NTFS_VOLUME_DATA,
|
||||
NULL, 0, &nvdb, sizeof nvdb);
|
||||
if (!NT_SUCCESS (status))
|
||||
debug_printf ("%p = NtFsControlFile(%S,FSCTL_GET_NTFS_VOLUME_DATA)",
|
||||
debug_printf ("%p = NtFsControlFile(%S, FSCTL_GET_NTFS_VOLUME_DATA)",
|
||||
status, pc.get_nt_native_path ());
|
||||
else
|
||||
sfs->f_blocks = nvdb.TotalClusters.QuadPart;
|
||||
@ -1030,7 +1030,7 @@ fhandler_disk_file::ftruncate (_off64_t length, bool allow_truncate)
|
||||
{
|
||||
status = NtFsControlFile (get_handle (), NULL, NULL, NULL, &io,
|
||||
FSCTL_SET_SPARSE, NULL, 0, NULL, 0);
|
||||
syscall_printf ("%p = NtFsControlFile(%S,FSCTL_SET_SPARSE)",
|
||||
syscall_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
|
||||
status, pc.get_nt_native_path ());
|
||||
}
|
||||
status = NtSetInformationFile (get_handle (), &io,
|
||||
|
Reference in New Issue
Block a user