#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <stdio.h>
#include <string.h>
static errcode_t raw_read_blk(io_channel channel,
struct unix_private_data *data,
unsigned long long block,
- int count, void *buf)
+ int count, void *bufv)
{
errcode_t retval;
ssize_t size;
ext2_loff_t location;
int actual = 0;
+ unsigned char *buf = bufv;
size = (count < 0) ? -count : count * channel->block_size;
data->io_stats.bytes_read += size;
static errcode_t raw_write_blk(io_channel channel,
struct unix_private_data *data,
unsigned long long block,
- int count, const void *buf)
+ int count, const void *bufv)
{
ssize_t size;
ext2_loff_t location;
int actual = 0;
errcode_t retval;
+ const unsigned char *buf = bufv;
if (count == 1)
size = channel->block_size;
open_flags = (flags & IO_FLAG_RW) ? O_RDWR : O_RDONLY;
if (flags & IO_FLAG_EXCLUSIVE)
open_flags |= O_EXCL;
+#ifdef O_DIRECT
if (flags & IO_FLAG_DIRECT_IO)
open_flags |= O_DIRECT;
+#endif
data->flags = flags;
#ifdef HAVE_OPEN64