mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-03 12:31:57 +00:00
add map_block0_write.c
This commit is contained in:
parent
6657d065cf
commit
37c6ac70c6
@ -28,7 +28,7 @@ SOURCES = map_bootblock_get_type.c map_bootblock_is_valid.c \
|
||||
map_partition_set_startup.c map_read.c map_seek_driver_partition.c \
|
||||
map_set_bootinfo.c map_set_driver_info.c map_set_driver_number.c \
|
||||
map_set_partition_name.c map_set_partition_type.c map_set_startup.c \
|
||||
map_write.c
|
||||
map_write.c map_block0_write.c
|
||||
|
||||
HEADERS = libmap.h
|
||||
|
||||
|
@ -180,4 +180,5 @@ extern int map_set_driver_info(map_t *map, int number, int block, int size, int
|
||||
extern int map_set_driver_number(map_t *map, int number);
|
||||
extern unsigned long map_get_driver_signature(map_t* map);
|
||||
extern int emile_block0_write(map_t *map);
|
||||
extern int map_block0_write(map_t *map);
|
||||
#endif
|
||||
|
23
libmap/map_block0_write.c
Normal file
23
libmap/map_block0_write.c
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
*
|
||||
* (c) 2004-2007 Laurent Vivier <Laurent@lvivier.info>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libmap.h"
|
||||
|
||||
int map_block0_write(map_t *map)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = lseek(map->fd, 0, SEEK_SET);
|
||||
if (ret != 0)
|
||||
return -1;
|
||||
|
||||
ret = write(map->fd, &map->drivers, sizeof(map->drivers));
|
||||
|
||||
return ret;
|
||||
}
|
Loading…
Reference in New Issue
Block a user