Commit 9b7d6a6b authored by Peyton, Jonathan L's avatar Peyton, Jonathan L
Browse files

[OpenMP] Fix too long name for shm segment on macOS

Remove the user id component to the shm segment name and just use
the pid like before.

Differential Revision: https://reviews.llvm.org/D92660
parent a5e6590b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -6360,7 +6360,8 @@ static inline char *__kmp_reg_status_name() {
   each thread. If registration and unregistration go in different threads
   (omp_misc_other_root_exit.cpp test case), the name of registered_lib_env
   env var can not be found, because the name will contain different pid. */
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB // shared memory is with dynamic library
// macOS* complains about name being too long with additional getuid()
#if KMP_OS_UNIX && !KMP_OS_DARWIN && KMP_DYNAMIC_LIB
  return __kmp_str_format("__KMP_REGISTERED_LIB_%d_%d", (int)getpid(),
                          (int)getuid());
#else