Go to the first, previous, next, last section, table of contents.


read

Syntax

#include <unistd.h>

ssize_t read(int fd, void *buffer, size_t length);

Description

This function reads at most length bytes from file fd into buffer. Note that in some cases, such as end-of-file conditions and text files, it may read less than the requested number of bytes. At end-of-file, read will read exactly zero bytes.

Return Value

The number of bytes read, zero meaning end-of-file, or -1 for an error.

Portability

not ANSI, POSIX

Example

char buf[10];
int r = read(0, buf, 10);


Go to the first, previous, next, last section, table of contents.