Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / w32process-unix-default.c
index 0b48370f369328e924f61d58f3a6dfddb9691699..91e1d218ad5dc60905cc1442759788ed2713e30d 100644 (file)
@@ -1,3 +1,6 @@
+/**
+ * \file
+ */
 
 #include "w32process.h"
 #include "w32process-unix-internals.h"
@@ -6,7 +9,7 @@
 
 #include <unistd.h>
 
-#ifdef PLATFORM_SOLARIS
+#ifdef HOST_SOLARIS
 /* procfs.h cannot be included if this define is set, but it seems to work fine if it is undefined */
 #if _FILE_OFFSET_BITS == 64
 #undef _FILE_OFFSET_BITS
 #endif
 #endif
 
+/* makedev() macro */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#elif defined MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
+
 #include "utils/mono-logger-internals.h"
 
 #ifndef MAXPATHLEN
@@ -31,7 +41,7 @@ mono_w32process_get_name (pid_t pid)
        gchar buf[256];
        gchar *ret = NULL;
 
-#if defined(PLATFORM_SOLARIS)
+#if defined(HOST_SOLARIS)
        filename = g_strdup_printf ("/proc/%d/psinfo", pid);
        if ((fp = fopen (filename, "r")) != NULL) {
                struct psinfo info;
@@ -142,8 +152,10 @@ mono_w32process_get_modules (pid_t pid)
        guint64 device;
 
        fp = open_process_map (pid, "r");
-       if (!fp)
+       if (!fp) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't open process map file for pid %d", __func__, pid);
                return NULL;
+       }
 
        while (fgets (buf, sizeof(buf), fp)) {
                p = buf;