next up previous contents
Next: rename: rename a file Up: MOSS system calls Previous: open: open a file

read: read from a file

SYNOPSIS

int read(int fd, void *buf, size_t nbyte);

DESCRIPTION

This system call implements the POSIX read function, which reads the next nbyte bytes of data into buf from file descriptor fd.

PARAMETERS

fd
The file descriptor to read from.
buf
The buffer to read data into.
nbyte
The total number of bytes to read.

RETURN VALUE

Returns the actual number of bytes read if successful, or -1 on error, in which case errno indicates the error.



Bryan Ford