RTEMS | libcsupport/libio: Add rtems_libio_iop_descriptors_open to return open descriptors (!117)

Gedare Bloom (@gedare) gitlab at rtems.org
Wed Jul 17 20:46:25 UTC 2024



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117 was reviewed by Gedare Bloom

--
  
Gedare Bloom started a new discussion on cpukit/include/rtems/libio_.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117#note_109458

 > + * Return the number of open iop descriptors
 > + */
 > +size_t rtems_libio_iop_descriptors_open( void );

The name seems wrong/confusing, as there are several `rtems_libio_iop_xxx( *iop )` functions that manipulate iops. Perhaps `rtems_libio_count_open_iops` or `rtems_libio_count_open_descriptors`?

--
  
Gedare Bloom started a new discussion on cpukit/include/rtems/libio_.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117#note_109459

 > + * Return the number of open iop descriptors
 > + */
 > +size_t rtems_libio_iop_descriptors_open( void );

Return type is questionable: `size_t` should only be used for something in the units of bytes.

--
  
Gedare Bloom started a new discussion on cpukit/libcsupport/src/libio.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117#note_109460

 > +{
 > +  size_t open = 0;
 > +  size_t i;

ditto

--
  
Gedare Bloom started a new discussion on testsuites/libtests/libiofdopen/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117#note_109461

 > +  int fd[10];
 > +  size_t i;
 > +  size_t base_count;

ditto

--
  
Gedare Bloom started a new discussion on testsuites/libtests/libiofdopen/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117#note_109462

 > +
 > +  base_count = rtems_libio_iop_descriptors_open();
 > +  printf("default open count = %zu\n", base_count);

avoid unnecessary `printf` in tests




-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/117
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240717/f4520481/attachment-0001.htm>


More information about the bugs mailing list