READ(2) UNIX Programmer's Manual READ(2) NAME read - read from file SYNOPSIS read(fildes, buffer, nbytes) char *buffer; unsigned nbytes; DESCRIPTION A file descriptor is a word returned from a successful _o_p_e_n, _c_r_e_a_t, _d_u_p, or _p_i_p_e(2) call. _B_u_f_f_e_r is the location of _n_b_y_t_e_s contiguous bytes into which the input will be placed. It is not guaranteed that all _n_b_y_t_e_s bytes will be read; for example if the file refers to a typewriter at most one line will be returned. In any event the number of characters read is returned. If the returned value is 0, then end-of-file has been reached. ERRORS _R_e_a_d will fail if one or more of the following is true: [EBADF] _F_i_l_d_e_s is not a valid file descriptor open for reading. [EFAULT] _B_u_f points outside the process's allo- cated address space. [EINTR] A read from a slow device was inter- rupted (before any data arrived) by the delivery of a signal. SEE ALSO creat(2), dup(2), open(2), pipe(2) ASSEMBLER (read = 3.) (file descriptor in r0) sys read; buffer; nbytes (byte count in r0) Printed 5/22/83 1