summaryrefslogtreecommitdiff
path: root/libraries/base/cbits/consUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/cbits/consUtils.c')
-rw-r--r--libraries/base/cbits/consUtils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libraries/base/cbits/consUtils.c b/libraries/base/cbits/consUtils.c
index af29b599f4..bb9e154e86 100644
--- a/libraries/base/cbits/consUtils.c
+++ b/libraries/base/cbits/consUtils.c
@@ -64,4 +64,17 @@ get_console_echo__(int fd)
return -1;
}
+int
+flush_input_console__(int fd)
+{
+ HANDLE h;
+ if ( (h = (HANDLE)_get_osfhandle(fd)) != INVALID_HANDLE_VALUE ) {
+ if ( FlushConsoleInputBuffer(h) ) {
+ return 0;
+ }
+ }
+ /* ToDo: translate GetLastError() into something errno-friendly */
+ return -1;
+}
+
#endif /* defined(mingw32_HOST_OS) || ... */