OPENDEV(3) BSD Programmer's Manual OPENDEV(3)
opendev - short form device open routine
#include <util.h> int opendev(char *path, int oflags, int dflags, char **realpath);
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. 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 matching device. 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 character device) If realpath is not NULL, it is modified to point at the fully expanded device name.
The opendev() return value and errors are the same as the return value and errors of open(2).
If realpath is not NULL, on return it will point to internal static storage space that will be overwritten by subsequent calls.
The opendev() function first appeared in OpenBSD 1.2. MirOS BSD #10-current February 15, 2000 1
Generated on 2015-10-25 00:47:46 by $MirOS: src/scripts/roff2htm,v 1.81 2015/10/16 13:19:09 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002–2015 The MirOS Project, Germany.
This product includes material provided by mirabilos.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.