fd_read
fd_read — reads a buffer or string from a file identified by a file
descriptor.
fd_read (fd, buffer|string, length?, offset?)
fdA file descriptor as returned from fd_open.
buffer|stringA buffer or string to be read from the file.
lengthAn integer specifying the length of the buffer or string.
offsetAn integer specifying the position in the file to begin reading the buffer or string.
The number of bytes actually read from the file, or -1 on failure and the errno is set.
This function reads a buffer or string from the specified file.
When an error occurs, the following errnos are possible:
EAGAIN The O_NONBLOCK flag is set for the fd
and the process would be delayed in the read operation.
EBADF The passed fd is invalid or not open
for writing.
EFBIG File is too big.
EINTR Read was interrupted by a signal.
EINVAL iovcnt was less than or equal to 0, or greater than UIO_MAXIOV.
EIO Physical I/O error.
Gamma>x = fd_open("/fd/ser1",O_RDWR);4Gamma>fd_read(x,"hello\n");6Gamma>fd_close(x);t