next up previous contents index
Next: 21.5.3 diskpart_blkio_get_partition: initialize an Up: 21.5 API reference Previous: 21.5.1 diskpart_get_partition: initialize an

21.5.2 diskpart_read_func: read a disk sector (user-provided callout)

 

SYNOPSIS

#include <oskit/diskpart/diskpart.h>

int diskpart_read_func(void *driver_info, int sector, char *buf);

DESCRIPTION

This function is called from diskpart_get_partition and diskpart_get_type whenever they need to read data from the target disk.

PARAMETERS

driver_info
The parameter passed to diskpart_get_partition and diskpart_get_type. Used to pass data through the diskpart library to this read routine.
sector
The sector to read.
buf
Memory location where the sector should be read in to. The buffer must be at least SECTOR_SIZE bytes.

RETURNS

Returns zero on success, non-zero to indicate an error.



University of Utah Flux Research Group