Code:
int _write(int fd, void* buf, size_t cnt) { Printf("_WRITE %u:%s, %d\n\r");
Note C has a few translation layers. One of them is a IO/File system layer on top of the operators layers.but why do I need to do this ?
The SDK uses a custom printf which bypasses the IO/File stream layer. Technically the printf implementation is capable of being compliant.
- The stdio implementation is used, which uses a construct called stdio_driver_t. So the SDK goes directly to their operators layer.
- Printf's primary egress is putchar which is mapped to stdio_putchar_raw. (https://github.com/search?q=repo%3Arasp ... &type=code)
In summary hooking the C operator subsystem will not work. Want to file a bug for this?I'm trying to fill in the stub functions in newlib and the SDK so that I can define custom I/O streams.
Statistics: Posted by dthacher — Tue Dec 10, 2024 3:08 pm