opendev - short form device open routine
opendev(char *path, int oflags, int dflags, char
The opendev() function opens a device using the ``short
This is typically ``sd0'' or ``sd0c'', for instance, which
will be expanded
to /dev/rsd0c on most architectures.
Device name lookup is done by first checking path for a
``/'' and if one
is found attempting to open that file. Otherwise /dev is
searched for a
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_BLCK open the block device (default is
If realpath is not NULL, it is modified to point at the fully expanded
The opendev() return value and errors are the same as the
and errors of open(2).
If realpath is not NULL, on return it will point to internal
space that will be overwritten by subsequent calls.
The opendev() function first appeared in OpenBSD 1.2.
OpenBSD 3.6 February 15, 2000
[ Back ]