next up previous contents index
Next: 21.5.4 diskpart_fill_entry: initialize a Up: 21.5 API reference Previous: 21.5.2 diskpart_read_func: read a

21.5.3 diskpart_blkio_get_partition: initialize an array of partition entries

 

SYNOPSIS

#include <oskit/diskpart/diskpart.h>

int diskpart_blkio_get_partition(oskit_blkio_t *block_io, struct diskpart *array, int array_size);

DESCRIPTION

This function initializes an array of struct diskpart entries. The caller must provide a pointer to a struct diskpart array.

This function is a version of diskpart_get_partition using an OSKit ``Block I/O'' interface in place of an explicit callback function.

PARAMETERS

block_io
An oskit_blkio_t that represents the disk whose partitions we are interested in.
array
Array of struct diskpart.
array_size
integer containing the number of allocated entries in the array.

RETURNS

Returns an integer count of the number of partition entries that were filled by the library. If there were more partitions found than space available, this will be array_size. Empty partitions (unused entries in a BSD disklabel, for example) occupy an entry the same as `used' entries.

For example, a PC-DOS partition with a single filled entry would still report 4 partitions, as that is the size of the DOS partition table.

RELATED INFORMATION

The OSKit Block I/O Interface (section 5.3).



University of Utah Flux Research Group