Merge "Create per-uid GCOV_PREFIX dir in the getenv wrapper"
diff --git a/toolchain-extras/profile-globals.c b/toolchain-extras/profile-globals.c
index 95bd46d..309f060 100644
--- a/toolchain-extras/profile-globals.c
+++ b/toolchain-extras/profile-globals.c
@@ -17,6 +17,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 
 // This file provides a wrapper for getenv that appends the userid (geteuid())
@@ -38,5 +39,6 @@
   }
 
   sprintf(modified_gcov_prefix, "%s/%u", __real_getenv(name), geteuid());
+  mkdir(modified_gcov_prefix, 0777);
   return modified_gcov_prefix;
 }