summaryrefslogtreecommitdiff
path: root/os-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-posix.c')
-rw-r--r--os-posix.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/os-posix.c b/os-posix.c
index 38c29d1afe..7971f8620b 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -41,6 +41,7 @@
#ifdef CONFIG_LINUX
#include <sys/prctl.h>
+#include <sys/syscall.h>
#endif
#ifdef CONFIG_EVENTFD
@@ -382,3 +383,12 @@ int qemu_create_pidfile(const char *filename)
return 0;
}
+
+int qemu_get_thread_id(void)
+{
+#if defined (__linux__)
+ return syscall(SYS_gettid);
+#else
+ return getpid();
+#endif
+}