*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> opendev (3)              



NAME    [Toc]    [Back]

     opendev - short form device open routine

SYNOPSIS    [Toc]    [Back]

     #include <util.h>

     opendev(char   *path,   int   oflags,   int   dflags,   char

DESCRIPTION    [Toc]    [Back]

     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.

RETURN VALUES    [Toc]    [Back]

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

WARNINGS    [Toc]    [Back]

     If realpath is not NULL, on return it will point to internal
static storage
 space that will be overwritten by subsequent calls.

SEE ALSO    [Toc]    [Back]

     open(2), getrawpartition(3)

HISTORY    [Toc]    [Back]

     The opendev() function first appeared in OpenBSD 1.2.

OpenBSD     3.6                        February     15,      2000
[ Back ]
 Similar pages
Name OS Title
open Linux open and possibly create a file or device
clone IRIX open any minor device on a STREAMS driver
st_ats_enabled HP-UX determines whether to reserve a tape device on open
ntohs Tru64 Convert an unsigned short (16-bit) integer from
groff FreeBSD a short reference for the GNU roff language
DtMmdbSectionGetShortTitle HP-UX obtains the short title for a section
DtMmdbBookGetShortTitle HP-UX obtains the short title of a book
groff NetBSD a short reference for the GNU roff language
perlreftut OpenBSD Mark's very short tutorial about references
_getshort Tru64 Retrieves short quantities from a byte stream
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service