Add gettid() for proper thread affinity on Linux
[fio.git] / os / os.h
diff --git a/os/os.h b/os/os.h
index 3df7b41be4b6447c73783abf03808b38ca2ee586..cd2bb523bb9ef931f27ea123c3e239bcdc035518 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -187,4 +187,11 @@ static inline unsigned int cpus_online(void)
 }
 #endif
 
 }
 #endif
 
+#ifndef FIO_HAVE_GETTID
+static inline int gettid(void)
+{
+       return getpid();
+}
+#endif
+
 #endif
 #endif