summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2016-06-19 21:42:09 -0700
committerPat Gavlin <pagavlin@microsoft.com>2016-06-19 21:42:09 -0700
commitbc3533fb742458bd6939f7f878bf8f477cbac791 (patch)
treea5217415d6dc17f4b892b80bb053b79e6e4e8b3c
parentb464dc317d49b84cf2e3a2e4f65813c23ea51a41 (diff)
downloadcoreclr-bc3533fb742458bd6939f7f878bf8f477cbac791.tar.gz
coreclr-bc3533fb742458bd6939f7f878bf8f477cbac791.tar.bz2
coreclr-bc3533fb742458bd6939f7f878bf8f477cbac791.zip
Disable buffering on jitstdout.
This avoid the need to call fflush() throughout the code.
-rwxr-xr-xsrc/jit/ee_il_dll.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp
index f51e4521e3..e4d05739b6 100755
--- a/src/jit/ee_il_dll.cpp
+++ b/src/jit/ee_il_dll.cpp
@@ -76,6 +76,10 @@ void __stdcall jitStartup(ICorJitHost* jitHost)
_setmode(jitstdoutFd, _O_TEXT);
jitstdout = _fdopen(jitstdoutFd, "w");
assert(jitstdout != nullptr);
+
+ // Prevent the FILE* from buffering its output in order to avoid calls to
+ // `fflush()` throughout the code.
+ setvbuf(jitstdout, nullptr, _IONBF, 0);
}
#endif