diff options
| author | Meco Man <[email protected]> | 2022-08-15 18:58:55 -0400 |
|---|---|---|
| committer | guo <[email protected]> | 2022-08-16 09:37:24 +0800 |
| commit | bd33d37bc49d549357d987ab34aadfd0159b411e (patch) | |
| tree | 0cc7fdc95732d4cd23990f8f3c44351226b4e476 /components/libc/cplusplus/SConscript | |
| parent | eb1261965401cb452b0559eaeeb9e125eae7ba5f (diff) | |
该问题在Keil-MDK中没有一个太好的解决方案。本PR为权衡利弊之后得到的一套解决方案。Keil曾经提供了底层桩函数_sys_ensure,但是目前已经被废弃。因此唯一的解决方案就是每写完一句,就调用fsync去同步一次。
该问题在mbedos社区也进行过讨论,他们也面临和我们相同的两个问题:
1. Keil-MDK无有效的fflush解决方案,mbedos依然在使用淘汰的_sys_ensure桩函数。
2. Keil-MDK没有fileno函数,我方少部分软件包因此而无法使用Keil平台编译。
参考:https://github.com/ARMmbed/mbed-os/issues/1601
issue: https://github.com/RT-Thread/rt-thread/issues/4928
经过进一步测试发现,Keil-MDK中的fflush函数已经退化成服务于STDOUT的函数,Keil-MDK内部有一个buffer可以存放fputc(stdout) 发过来的数据,如果调用fflush,这些数据是可以flush出去的。但是如果是真正的文件数据,fflush函数并没有提供任何桩函数接口可以让文件flush数据出去。
Diffstat (limited to 'components/libc/cplusplus/SConscript')
0 files changed, 0 insertions, 0 deletions
