From de2ee43db06f00481c365935dfc9b084d3970a28 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 16 Dec 2003 23:41:27 +0000 Subject: 2003-12-16 Joel Sherrill PR 542/filesystem * include/rtems/libio_.h: Add rtems_libio_iop_to_descriptor macro to convert iop to the corresponding integer file descriptor. --- cpukit/libcsupport/ChangeLog | 6 ++++++ cpukit/libcsupport/include/rtems/libio_.h | 10 ++++++++++ 2 files changed, 16 insertions(+) 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 + + 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 * 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 * -- cgit v1.2.3