OPENDEV(3)

NAME
opendev - short form device open routine

SYNOPSIS
#include <util.h>
int
opendev(char *path, int oflags, int dflags, char **realpath);

DESCRIPTION
The opendev() function opens a device using the "short form" name. This is typically "sd0" or "sd0c", for instance, which will be expanded to /dev/rsd0c on most architectures.

The oflags are the same as the flags passed to open(2).

The dflags are specified by or'ing the following values:

    OPENDEV_PART	attempt to open the raw partition during expansion
    OPENDEV_DRCT	attempt to open the device itself during expansion

If realpath is not NULL, it is modified to point at the fully expanded device name.

RETURN VALUES
The opendev() return value and errors are the same as the return value and errors of open(2).

HISTORY
opendev() first appeared in OpenBSD 1.2.

SEE ALSO
open(2)