Added setStdIoUnbuffered for unbuffered stdio (fixes #2146).

This commit is contained in:
A. S. Budden 2016-06-12 07:40:28 +01:00
commit 52b4e8f661
3 changed files with 9 additions and 0 deletions

View file

@ -354,4 +354,9 @@ proc writeFile(filename, content: string) =
else:
sysFatal(IOError, "cannot open: ", filename)
proc setStdIoUnbuffered() =
discard setvbuf(stdout, nil, IONBF, 0)
discard setvbuf(stderr, nil, IONBF, 0)
discard setvbuf(stdin, nil, IONBF, 0)
{.pop.}