MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
OPENDEV(3)               BSD Library Functions Manual               OPENDEV(3)

NAME
     opendev -- short form device open routine

SYNOPSIS
     ##include <>

     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 ``disk0s3'', for instance, which will be expanded to
     /dev/rdisk0s3 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:

           OPENDEVPART    attempt to open the raw partition during expansion
           OPENDEVBLCK    open the block device (default is character device)

     The ``raw'' partition is defined as the partition which provides access
     to the entire disk, regardless of the disk's partition map.

     If realpath is not NUL, 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).

WARNINGS
     If realpath is not NUL, on return it will point to internal static stor-
     age space that will be overwritten by subsequent calls.

SEE ALSO
     open(2)

HISTORY
     The opendev() function first appeared in OpenBSD 1.2.

BSD                            December 12, 2002                           BSD
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™