close.c
This routine will allow for the closing of both network connections and file system devices. If the file descriptor is associated with a network device, the appropriate network function handler will be selected from a table of previously registered network functions (rtems_libio_handlers) and that function will be invoked.
If the file descriptor refers to an entry in the filesystem, the appropriate handler will be selected using information that has been placed in the file control block for the device (rtems_libio_t structure).
rtems_file_descriptor_type examines some of the upper bits of the file descriptor index. If it finds that the upper bits are set in the file descriptor index, the device referenced is a network device.
Network device handlers are obtained from a special registration table (rtems_libio_handlers) that is set up during network initialization. The network handler invoked and the status of the network handler will be returned to the calling process.
If none of the upper bits are set in the file descriptor index, the file descriptor refers to an element of the RTEMS filesystem.
The following sequence will be performed for any filesystem file descriptor:
Copyright © 1988-2004 OAR Corporation