Table of Contentsread - read from a file descriptor #include <sys/types.h> #include <unistd.h>
int read(int fd, char *buf, size_t count); read reads up to count bytes from file descriptor fd into the buffer starting at buf. On success, the number of bytes read are returned (zero indicates end of file). On error, -1 is returned, and errno is set appropriately. - EINTR
- The call was interrupted by a signal before any data was read.
- EAGAIN
- Non-blocking I/O has been selected using O_NONBLOCK and no data was immediately available for reading.
- EISDIR
- fd refers to a directory.
- EBADF
- fd is not a valid file descriptor or is not open for reading.
- EINVAL
- fd is attached to an object which is unsuitable for reading.
- EFAULT
- buf is outside your accessible address space.
Other errors may occur, depending on the object connected to fd.
SVID, AT&T, POSIX, X/OPEN, BSD 4.3 readdir(2), write(2), write(2), fcntl(2), close(2), lseek(2), select(2), readlink(2), ioctl(2), fread(3).
Table of Contents
www.fiveanddime.net