You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple solution to avoid unexpected output by the buffered I/O 'printf' is
using low-level I/O interface 'write'. It works because 'printf' will wait to
write to STDOUT until the buffer is full, or on some other conditions. Using
write, however, can write to STDOUT immediately.
Here is a naive implementation for the idea with some limitation and weakness
that need improvement:
1. It will fail if the formatted string with length >64
2. The function 'write' can write less than n bytes. It will need further
handling if happens.
0 commit comments