


      RRRREEEEAAAADDDD((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    RRRREEEEAAAADDDD((((2222))))



      NNNNAAAAMMMMEEEE
           read - read from file

      SSSSYYYYNNNNTTTTAAAAXXXX
           iiiinnnntttt rrrreeeeaaaadddd ((((ffffiiiillllddddeeeessss,,,, bbbbuuuuffff,,,, nnnnbbbbyyyytttteeee))))
           iiiinnnntttt ffffiiiillllddddeeeessss;;;;
           cccchhhhaaaarrrr ****bbbbuuuuffff;;;;
           uuuunnnnssssiiiiggggnnnneeeedddd nnnnbbbbyyyytttteeee;;;;

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _F_i_l_d_e_s is a file descriptor obtained from a _c_r_e_a_t, _o_p_e_n,
           _d_u_p, or _f_c_n_t_l system call.

           _R_e_a_d attempts to read _n_b_y_t_e bytes from the file associated
           with _f_i_l_d_e_s into the buffer pointed to by _b_u_f.

           On devices capable of seeking, the _r_e_a_d starts at a position
           in the file given by the file pointer associated with
           _f_i_l_d_e_s.  Upon return from _r_e_a_d, the file pointer is
           incremented by the number of bytes actually read.

           Devices that are incapable of seeking always read from the
           current position.  The value of a file pointer associated
           with such a file is undefined.

           Upon successful completion, _r_e_a_d returns the number of bytes
           actually read and placed in the buffer; this number may be
           less than _n_b_y_t_e if the file is associated with a
           communication line (see _i_o_c_t_l(2) and _t_e_r_m_i_o(7)), or if the
           number of bytes left in the file is less than _n_b_y_t_e bytes.
           A value of 0 is returned when an end-of-file has been
           reached.

           When attempting to read a file associated with a tty that
           has no data currently available:

                If O_NDELAY is set, the read will return a 0.

                If O_NDELAY is clear, the read will block until data
                becomes available.

           _R_e_a_d will fail if one or more of the following are true:

                _F_i_l_d_e_s is not a valid file descriptor open for reading.
                [EBADF]

                _B_u_f points outside the allocated address space.
                [EFAULT]

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           Upon successful completion a non-negative integer is
           returned indicating the number of bytes actually read.



      Page 1                                                   (9010-E)






      RRRREEEEAAAADDDD((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    RRRREEEEAAAADDDD((((2222))))



           Otherwise, a -1 is returned and _e_r_r_n_o is set to indicate the
           error.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           creat(2), dup(2), fcntl(2), ioctl(2), open(2), termio(7).


















































      Page 2                                                   (9010-E)



