diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp --- a/openmp/runtime/src/z_Linux_util.cpp +++ b/openmp/runtime/src/z_Linux_util.cpp @@ -2021,7 +2021,11 @@ /* On GNUish OSes, read the /proc//maps pseudo-file to get all the address ranges mapped into the address space. */ +#if KMP_OS_LINUX + const char *name = "/proc/self/maps"; +#else char *name = __kmp_str_format("/proc/%d/maps", getpid()); +#endif FILE *file = NULL; file = fopen(name, "r"); @@ -2053,7 +2057,9 @@ // Free resources. fclose(file); +#if !KMP_OS_LINUX KMP_INTERNAL_FREE(name); +#endif #elif KMP_OS_FREEBSD char *buf; size_t lstsz;