Skip to content

[llvm] Android has sched_getaffinity() now #124689

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
Jan 28, 2025

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Jan 28, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jan 28, 2025

@llvm/pr-subscribers-llvm-support

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124689.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 aedcd9aa34b99a..15a5b008604c32 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -387,7 +387,7 @@ static int computeHostNumPhysicalCores() {
 static int computeHostNumPhysicalCores() {
   return sysconf(_SC_NPROCESSORS_ONLN);
 }
-#elif defined(__linux__) && !defined(__ANDROID__)
+#elif defined(__linux__)
 static int computeHostNumPhysicalCores() {
   cpu_set_t Affinity;
   if (sched_getaffinity(0, sizeof(Affinity), &Affinity) == 0)

Copy link
Contributor

@enh-google enh-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i can confirm that we've had sched_getaffinity() since api 12 in 2011 :-)

@brad0 brad0 merged commit cfdd937 into llvm:main Jan 28, 2025
10 checks passed
@brad0 brad0 deleted the llvm_support_unix_threading_android branch January 28, 2025 18:21
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.

3 participants