This routine is layered on a set of RTEMS calls and filesystem specific
read operations. The functions are layered in such a way as to isolate
them from change as new filesystems are introduced.
Development Comments:
This routine will examine the type of file descriptor it is sent.
If the file descriptor is associated with a network device, the read
function will be mapped to a special network handler. The return code from
the network handler will then be sent as the return code from generic
read() function.
For file descriptors that are associated with the filesystem the following
sequence will be performed:
Obtain the file control block associated with the file descriptor
Range check the file descriptor
Determine that the buffer pointer is not invalid
Check that the count is not zero
Check the file control block to see if we have permissions to read
If there is a read function in the handler table, invoke the handler
table read() function
Use the return code from the handler table read function(number of
bytes read) to increment the offset element of the file control block
Return the number of bytes read to the calling program