next up previous contents index
Next: 21.5.7 diskpart_lookup_bsd_string: search for Up: 21.5 API reference Previous: 21.5.5 diskpart_dump: print a

21.5.6 diskpart_lookup_bsd_compat: search for a partition entry

 

SYNOPSIS

#include <oskit/diskpart/diskpart.h>

struct diskpart *diskpart_lookup_bsd_compat(struct diskpart *array, short slice, short part);

DESCRIPTION

This function is a sample lookup routine which finds a partition given a slice number and partition number.

This demonstrates how a two-level naming scheme can be implemented using integers. This was first used in Mach 4 (UK22) to provide support for FreeBSD slices as well as backwards-compatibility with previous naming methods.

PARAMETERS

array
This should be the pointer to the start of the array.
slice
Slice 0 is used as a `compatibility slice', in that it is aliased to a BSD partition, if it exists. This allows users to not specify the slice for compatibility.
part
Partition 0 is used to represent the whole slice, and Partition 0, Slice 0 is the whole drive.

RETURNS

Returns a pointer to the corresponding partition entry, or zero if it is invalid.



University of Utah Flux Research Group