next up previous contents index
Next: 29.2.2 oskit_linux_block_open_kdev: Open a Up: 29.2 Obtaining object references Previous: 29.2 Obtaining object references

29.2.1 oskit_linux_block_open: Open a disk given its Linux name

 

SYNOPSIS

#include <oskit/dev/linux.h>

oskit_error_t oskit_linux_block_open(const char *name, unsigned flags, [out] oskit_blkio_t **out_io);

DESCRIPTION

This function takes a Linux name of a disk, e.g., ``sd0'' or ``wd1'', and returns an oskit_blkio_t that can be used to access the device.

The oskit_blkio interface is described in Chapter 5.

PARAMETERS

name
The Linux name of the device e.g., ``sd0'' or ``wd1''.

flags
Formed by or'ing the following values:
OSKIT_DEV_OPEN_READ
OSKIT_DEV_OPEN_WRITE
OSKIT_DEV_OPEN_ALL

out_io
Upon success, is set to point to an oskit_blkio_t that can be used to access the device.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group