EMILE/libmap/map_partition_read.c

28 lines
486 B
C
Raw Normal View History

/*
*
* (c) 2004-2007 Laurent Vivier <Laurent@lvivier.info>
*
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include "libmap.h"
2007-10-09 20:40:37 +00:00
int map_partition_read(map_t* map, off_t offset, size_t size, char* sector)
{
int ret;
if (!map_partition_is_valid(map))
return -1;
offset += read_long((u_int32_t*)&map->partition.PyPartStart);
ret = map->device->read_sector(map->device->data, offset, sector, size);
return ret;
}