aboutsummaryrefslogtreecommitdiff
path: root/os-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-win32.c')
-rw-r--r--os-win32.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/os-win32.c b/os-win32.c
index d98fd77c12..3c6f50fa94 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -34,6 +34,21 @@
#include "qemu-options.h"
/***********************************************************/
+/* Functions missing in mingw */
+
+int setenv(const char *name, const char *value, int overwrite)
+{
+ int result = 0;
+ if (overwrite || !getenv(name)) {
+ size_t length = strlen(name) + strlen(value) + 2;
+ char *string = qemu_malloc(length);
+ snprintf(string, length, "%s=%s", name, value);
+ result = putenv(string);
+ }
+ return result;
+}
+
+/***********************************************************/
/* Polling handling */
typedef struct PollingEntry {
@@ -206,6 +221,12 @@ char *os_find_datadir(const char *argv0)
return NULL;
}
+void os_set_line_buffering(void)
+{
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+}
+
/*
* Parse OS specific command line options.
* return 0 if option handled, -1 otherwise