RTEMS Logo

RTEMS 4.9.4 On-Line Library


closedir

PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

4.6: closedir

File:

closedir.c

Processing:

The code was obtained from the BSD group. This routine must clean up the memory resources that are required to track an open directory. The code is layered on the close() function and standard memory free() functions. It should not require alterations to support other filesystems.

Development Comments:

The routine alters the file descriptor and the index into the DIR structure to make it an invalid file descriptor. Apparently the memory that is about to be freed may still be referenced before it is reallocated.

The dd_buf structure's memory is reallocated before the control structure that contains the pointer to the dd_buf region.

DIR control memory is reallocated.

The close() function is used to free the file descriptor index.


PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

Copyright © 1988-2008 OAR Corporation