Chris Johns commented on a discussion on cpukit/include/rtems/libio_.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125257 > - * flags and error. > + * @brief Function to get the iop for the specified file descriptor > + * with access flags and error. > * > * Checks that the file descriptor is in the valid range and open. > */ > +static inline int rtems_libio_get_iop_with_access( > + int fd, rtems_libio_t **iop, unsigned int access_flags, int access_error > +) > +{ > + if ( (uint32_t) ( fd ) >= rtems_libio_number_iops ) { > + return EBADF; > + } > + *iop = rtems_libio_iop( fd ); > + const unsigned int flags = rtems_libio_iop_hold( *iop ); > + const unsigned int mandatory = LIBIO_FLAGS_OPEN | access_flags ; Yes, too much C++. We do loose the `const` bit :grinning: I have also set `*iop` to `NULL` on error in case a use does not check the result returned. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125257 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
