summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-12-16 23:41:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-12-16 23:41:27 +0000
commitde2ee43db06f00481c365935dfc9b084d3970a28 (patch)
tree80c5fa7bdd4738fecfa1caa21475df354ec1459e
parent2003-12-16 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-de2ee43db06f00481c365935dfc9b084d3970a28.tar.bz2
2003-12-16 Joel Sherrill <joel@OARcorp.com>
PR 542/filesystem * include/rtems/libio_.h: Add rtems_libio_iop_to_descriptor macro to convert iop to the corresponding integer file descriptor.
-rw-r--r--cpukit/libcsupport/ChangeLog6
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h10
2 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog
index 984f7bd28d..2f39fdeace 100644
--- a/cpukit/libcsupport/ChangeLog
+++ b/cpukit/libcsupport/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-16 Joel Sherrill <joel@OARcorp.com>
+
+ PR 542/filesystem
+ * include/rtems/libio_.h: Add rtems_libio_iop_to_descriptor macro to
+ convert iop to the corresponding integer file descriptor.
+
2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES.
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index 0d0e5ffd9b..841c3e38a8 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -54,6 +54,16 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
((((unsigned32)(_fd)) < rtems_libio_number_iops) ? \
&rtems_libio_iops[_fd] : 0)
+/*
+ * rtems_libio_iop_to_descriptor
+ *
+ * Macro to convert an internal file descriptor pointer (iop) into
+ * the integer file descriptor used by the "section 2" system calls.
+ */
+
+#define rtems_libio_iop_to_descriptor(_iop) \
+ ((!(_iop)) ? -1 : (_iop - rtems_libio_iops))
+
/*
* rtems_libio_check_is_open
*