While working on an [adaption for (integration of) USB-devices],(https://github.com/nerilex/libmsr/tree/usb-support) into the library, the direct use of file descriptors turned out problematic.
I temporarily solved it for my for by using a msrio abstraction layer which manages a table of functions and handlers into which the former filedescriptors are now just indexes.
A generic void* or some other opaque pointer given to the application would probably ease abstraction and avoid the allocation of tables.
While working on an [adaption for (integration of) USB-devices],(https://github.com/nerilex/libmsr/tree/usb-support) into the library, the direct use of file descriptors turned out problematic.
I temporarily solved it for my for by using a
msrioabstraction layer which manages a table of functions and handlers into which the former filedescriptors are now just indexes.A generic
void*or some other opaque pointer given to the application would probably ease abstraction and avoid the allocation of tables.