Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd flushing behavior #30

Open
mcandre opened this issue Jan 11, 2019 · 2 comments
Open

Odd flushing behavior #30

mcandre opened this issue Jan 11, 2019 · 2 comments

Comments

@mcandre
Copy link

mcandre commented Jan 11, 2019

I'm used to fprintf() intelligently flushing my output streams, e.g. when writing brief text blurbs to stderr in a Read Eval Print Loop application. However, CloudABI appears to wait until the program is terminating to flush. Could we get the flushing behavior closer to a typical GNU/libc fprintf() implicit flush?

As a workaround, I am doing this for important user feedback sections:

fprintf(console, "blahblahblah\n");

#if defined(__CloudABI__)
    fflush(console);
#endif
@EdSchouten
Copy link
Member

Hey! That's because on CloudABI, pipes and TTYs are treated identically. If you want line buffering, just call setvbuf() after opening the stream.

@mcandre
Copy link
Author

mcandre commented Jun 26, 2020

@EdSchouten Oh, thank you for clarifying!

Would it make sense for the yaml config to offer a tty bool option on fd's? Perhaps this could automatically be enabled for the stdout, stderr streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants