diff options
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libio_.h')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 * |