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 @@ -2018,13 +2018,12 @@ #if KMP_OS_LINUX || KMP_OS_HURD - /* On GNUish OSes, read the /proc//maps pseudo-file to get all the + /* On GNUish OSes, read the /proc/self/maps pseudo-file to get all the address ranges mapped into the address space. */ - char *name = __kmp_str_format("/proc/%d/maps", getpid()); FILE *file = NULL; - file = fopen(name, "r"); + file = fopen("/proc/self/maps", "r"); KMP_ASSERT(file != NULL); for (;;) { @@ -2053,7 +2052,6 @@ // Free resources. fclose(file); - KMP_INTERNAL_FREE(name); #elif KMP_OS_FREEBSD char *buf; size_t lstsz;