Unix/Linux Go Back    

Unix Version 7 - man page for read (v7 section 2)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

READ(2) 										  READ(2)

       read - read from file

       read(fildes, buffer, nbytes)
       char *buffer;

       A  file	descriptor  is	a word returned from a successful open, creat, dup, or pipe call.
       Buffer is the location of nbytes contiguous bytes into which the input will be placed.  It
       is  not guaranteed that all nbytes 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.

       open(2), creat(2), dup(2), pipe(2)

       As  mentioned,  0  is returned when the end of the file has been reached.  If the read was
       otherwise unsuccessful the return value is -1.  Many conditions	can  generate  an  error:
       physical  I/O errors, bad buffer address, preposterous nbytes, file descriptor not that of
       an input file.

       (read = 3.)
       (file descriptor in r0)
       sys read; buffer; nbytes
       (byte count in r0)

Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 01:49 PM.