int read(fildes, buf, nbyte);
read attempts to ready nbyte bytes from the file associated with fildes into the buffer pointed to by buf.
On devices capable of seeking, the read starts at a position in the file given by the file pointer associated with fildes Upon return from read, the file pointer is incremented by the number of bytes read.
Devices that are incapable of seeking always read from the current position. The value of a file pointer with such a file is undefined.
Upon successful completion, a read returns the number of bytes read and placed in the buffer. The number of bytes read may be less than nbytes if the file is associated with a communication line (See tty(4P) and ioctl(2P) ), or the number of bytes left in the file is less than nbyte bytes. A value of 0 is returned when an end-of-file has been reached.
read will fail if fildes is not a valid file descriptor open for reading. [EBADF]