RTEMS Logo

RTEMS 4.9.3 On-Line Library


read

PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

4.24: read

File:

deviceio.c

Processing:

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:

  1. Obtain the file control block associated with the file descriptor
  2. Range check the file descriptor
  3. Determine that the buffer pointer is not invalid
  4. Check that the count is not zero
  5. Check the file control block to see if we have permissions to read
  6. If there is a read function in the handler table, invoke the handler table read() function
  7. Use the return code from the handler table read function(number of bytes read) to increment the offset element of the file control block
  8. Return the number of bytes read to the calling program


PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

Copyright © 1988-2008 OAR Corporation