Merge pull request #618 from knocte/aspnet_lru
[mono.git] / mono / profiler / utils.c
index 1aa4756fec5d5f050c28cb43cfe8d02dd0cda8ee..8bf57a72f7c10e0e68e48ef63215d79e455a1a1c 100644 (file)
@@ -18,6 +18,7 @@
 #include <time.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #ifdef HOST_WIN32
 #include <windows.h>
 #else
@@ -46,7 +47,7 @@ static mach_timebase_info_data_t timebase_info;
 
 #define TICKS_PER_SEC 1000000000LL
 
-#if (defined(TARGET_X86) || defined(TARGET_AMD64)) && defined(__linux__)
+#if (defined(TARGET_X86) || defined(TARGET_AMD64)) && defined(__linux__) && defined(HAVE_SCHED_GETCPU)
 #define HAVE_RDTSC 1
 #endif
 
@@ -412,3 +413,13 @@ thread_id (void)
 #endif
 }
 
+uintptr_t
+process_id (void)
+{
+#ifdef HOST_WIN32
+       return 0; /* FIXME */
+#else
+       return (uintptr_t)getpid ();
+#endif
+}
+