Xinu7/man/man2/open.doc




OPEN(2)             Xinu Programmer's Manual              OPEN(2)



NAME
     open - device independent open routine

SYNOPSIS
     int open(dev, name, mode)
     int dev;
     char *name;
     char *modes;

DESCRIPTION
     _O_p_e_n will establish connection with the device given by _d_e_v
     using the null-terminated string _n_a_m_e to name an object on
     that device, and null-terminated string _m_o_d_e to specify the
     access mode for that object.  Valid access mode characters
     include r (read), w (write), o (old), and n (new) as speci-
     fied in ACCESS(2).

     _O_p_e_n returns SYSERR if _d_e_v is incorrect or cannot be opened.
     If successful, the value returned by _o_p_e_n depends on the
     device.  Most calls to open return a device descriptor that
     can be used in subsequent calls to _r_e_a_d_f_1 _o_r _w_r_i_t_e.  For
     example, calling _o_p_e_n on a disk device with a file name as
     an argument produces a descriptor by which that file can be
     accessed.

SEE ALSO
     access(2), close(2), ckmode(3), namespace(4)

BUGS
     Not all devices produce meaningful return values for _o_p_e_n.

























Version 6b               Printed 1/12/87                        1