Skip to content

[llvm][Support] Use __NR_gettid on Linux for compat with older glibc #120007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Dec 15, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Dec 15, 2024

@llvm/pr-subscribers-llvm-support

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/120007.diff

1 Files Affected:

  • (modified) llvm/lib/Support/Unix/Threading.inc (+1-1)
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index c7b4c7af3b9f33..aedcd9aa34b99a 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -141,7 +141,7 @@ uint64_t llvm::get_threadid() {
 #elif defined(__ANDROID__)
   return uint64_t(gettid());
 #elif defined(__linux__)
-  return uint64_t(syscall(SYS_gettid));
+  return uint64_t(syscall(__NR_gettid));
 #else
   return uint64_t(pthread_self());
 #endif

@brad0 brad0 merged commit 6ea8b4c into llvm:main Dec 18, 2024
10 checks passed
@brad0 brad0 deleted the llvm_threading_linux branch December 18, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants