From 6d940e0f88f76cd19717c3421929de05a7c8ac94 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 26 Apr 2012 17:07:47 -0400 Subject: [PATCH] Fix: getcpu build with modern uClibc versions uClibc has sched_getcpu since 0.9.33, so the compat workaround should only be used for older uClibc versions. Fixes #225 Signed-off-by: Peter Korsgaard Signed-off-by: Mathieu Desnoyers --- libringbuffer/getcpu.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libringbuffer/getcpu.h b/libringbuffer/getcpu.h index 0a619417..dbc186c1 100644 --- a/libringbuffer/getcpu.h +++ b/libringbuffer/getcpu.h @@ -41,7 +41,10 @@ int lttng_ust_get_cpu(void) */ #ifdef __linux__ -#ifdef __UCLIBC__ +/* old uClibc versions didn't have sched_getcpu */ +#if defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && \ + (__UCLIBC_MINOR__ < 9 || \ + (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32)) #include #define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache) /* -- 2.34.1