Guest User

firefox and palemoon fix build with Glibc lesser than 2.12 version

a guest
Oct 20th, 2024
79
0
89 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.05 KB | Spirit | 0 0
  1. # HG changeset patch
  2. # User Andrew Paprocki <[email protected]>
  3. # Date 1429932392 14400
  4. #      Fri Apr 24 23:26:32 2015 -0400
  5. # Node ID df67e9784e4089fe57653aa766c893ac60b6bdd4
  6. # Parent  ccd270cfe90bd2ee68a3865fcf1c06175f6f9f00
  7. Bug 1107944 - Support setting thread name on systems without glibc-2.12. r=jorendorff
  8.  
  9. diff --git a/js/src/vm/PosixNSPR.cpp b/js/src/vm/PosixNSPR.cpp
  10. --- a/js/src/threading/posix/Thread.cpp
  11. +++ b/js/src/threading/posix/Thread.cpp
  12. @@ -159,8 +159,14 @@
  13.    rv = 0;
  14.  #elif defined(__NetBSD__)
  15.    rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
  16. +#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 12)
  17. +  rv = pthread_setname_np(pthread_self(), name);
  18. +#elif defined(__linux) && defined(PR_SET_NAME)
  19. +  // PR_SET_NAME was added in Linux 2.6.9 and is the fallback when the
  20. +  // newer pthread_setname_np() added in glibc-2.12 is not available.
  21. +  rv = prctl(PR_SET_NAME, (unsigned long)(uintptr_t)name, 0, 0, 0);
  22.  #else
  23. -  rv = pthread_setname_np(pthread_self(), name);
  24. +  rv = -1;
  25.  #endif
  26.    MOZ_RELEASE_ASSERT(!rv);
  27.  }
Advertisement
Add Comment
Please, Sign In to add comment