summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/include/rtems/libio_.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libio_.h')
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index c2fb975bf7..85f9c8e0a5 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -89,15 +89,21 @@ extern rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry;
*/
extern rtems_filesystem_global_location_t rtems_filesystem_global_location_null;
-/*
- * rtems_libio_iop
+/**
+ * @brief Maps a file descriptor to the iop.
+ *
+ * The file descriptor must be a valid index into the iop table.
+ *
+ * @param[in] fd The file descriptor.
*
- * Macro to return the file descriptor pointer.
+ * @return The iop corresponding to the specified file descriptor.
+ *
+ * @see rtems_libio_check_fd().
*/
-
-#define rtems_libio_iop(_fd) \
- ((((uint32_t)(_fd)) < rtems_libio_number_iops) ? \
- &rtems_libio_iops[_fd] : 0)
+static inline rtems_libio_t *rtems_libio_iop( int fd )
+{
+ return &rtems_libio_iops[ fd ];
+}
/*
* rtems_libio_iop_to_descriptor