int read(int fd, void *buf, size_t nbyte);
This system call implements the POSIX read function, which reads the next nbyte bytes of data into buf from file descriptor fd.
- fd
- The file descriptor to read from.
- buf
- The buffer to read data into.
- nbyte
- The total number of bytes to read.
Returns the actual number of bytes read if successful, or -1 on error, in which case errno indicates the error.