diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 10 |
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 * |