Added setStdIoUnbuffered for unbuffered stdio (fixes #2146).
This commit is contained in:
parent
aadc154c95
commit
52b4e8f661
3 changed files with 9 additions and 0 deletions
|
|
@ -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.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue