Implement ntfs_device_win32_sync().

(Logical change 1.459)
edge.strict_endians
cantab.net!aia21 2004-07-15 09:37:03 +00:00
parent 0d5f1fdb3e
commit 40d7371812
1 changed files with 13 additions and 3 deletions

View File

@ -563,11 +563,21 @@ static s64 win32_filepos(struct ntfs_device *dev)
return fd->current_pos.QuadPart;
}
/**
* ntfs_device_win32_sync - Flush write buffers to disk.
* @dev: An NTFS_DEVICE obtained via the open command.
*
* Return 0 if o.k.
* -errno if not, in this case handle is trashed.
*/
static int ntfs_device_win32_sync(struct ntfs_device *dev)
{
fprintf(stderr, "win32_fsync() unimplemented\n");
errno = ENOTSUP;
return -1;
if (FlushFileBuffers(((win32_fd *)dev->d_private)->handle)) {
return 0;
} else {
errno = ntfs_w32error_to_errno(GetLastError());
return -errno;
}
}
static s64 ntfs_device_win32_write(struct ntfs_device *dev, const void *buffer,