From: Laurent Mazet Date: Fri, 17 Oct 2025 21:44:57 +0000 (+0200) Subject: adapt for android X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=b59bc6c84e42c7a39b2f8edb7407d7509e45fc5b;p=benchmarks.git adapt for android --- diff --git a/load.c b/load.c index bc370fb..15b734b 100644 --- a/load.c +++ b/load.c @@ -309,8 +309,8 @@ int main (int argc, char *argv[]) cpu_set_t cpu_mask; CPU_ZERO (&cpu_mask); CPU_SET (0, &cpu_mask); - if (pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpu_mask) != 0) { - fprintf (stderr, "error: pthread_setaffinity_np\n"); + if (sched_setaffinity (0, sizeof (cpu_set_t), &cpu_mask) != 0) { + fprintf (stderr, "error: sched_setaffinity\n"); return 1; } while (mode--) { diff --git a/test.c b/test.c index 66d492f..e6250ed 100644 --- a/test.c +++ b/test.c @@ -71,8 +71,8 @@ void *launch (void *arg) cpu_set_t cpu_mask; CPU_ZERO (&cpu_mask); CPU_SET (cpu, &cpu_mask); - if (pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpu_mask) != 0) { - fprintf (stderr, "error: pthread_setaffinity_np (%d)\n", cpu); + if (sched_setaffinity (0, sizeof (cpu_set_t), &cpu_mask) != 0) { + fprintf (stderr, "error: sched_setaffinity (%d)\n", cpu); rc = 1; pthread_exit (NULL); }