mirror of
https://github.com/vivier/EMILE.git
synced 2024-11-14 22:04:43 +00:00
28 lines
488 B
C
28 lines
488 B
C
/*
|
|
*
|
|
* (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"
|
|
|
|
int map_partition_write(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->write_sector(map->device->data, offset, sector, size);
|
|
|
|
return ret;
|
|
}
|