stdio.c - device types
Posted: Wed Aug 23, 2006 4:44 am
I was reviewing the stdio. code and noticed that newer device types are not specified (usb_mass, hdd). So __stdio_get_fd_type() always returns -1 if used.
What about adding these devices ? this would allow to access any device using the standard functions (fopen, fread, ...) and without having to care about the device itself. So each function in stdio.c could check __iob.type and use (for example) fioOpen or fileXioOpen depending of the device type.
the only problem is that it adds a dependency with fileXio, but is it really a problem ?
of course it's not really needed with usb_mass (as default case is fine for it), but it could be nice for the hdd.
thank you for your feedback :)
evilo.
What about adding these devices ? this would allow to access any device using the standard functions (fopen, fread, ...) and without having to care about the device itself. So each function in stdio.c could check __iob.type and use (for example) fioOpen or fileXioOpen depending of the device type.
the only problem is that it adds a dependency with fileXio, but is it really a problem ?
of course it's not really needed with usb_mass (as default case is fine for it), but it could be nice for the hdd.
thank you for your feedback :)
evilo.