read

Reads data from a file

int read (
        int fd,
        char *buf,
        int n
)

Arguments

fd File descriptor
buf Pointer to read buffer
n Number of bytes to read

Return Value

The number of bytes read up to normal termination is returned.
-1 is returned if an error occurred.

Explanation

n bytes are read from the file specified by fd and placed in the buffer pointed to by buf.

See Also

open()