From: Peter Korsgaard Date: Thu, 26 Apr 2012 21:07:47 +0000 (-0400) Subject: Fix: getcpu build with modern uClibc versions X-Git-Tag: v2.1.0-rc1~90 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6d940e0f88f76cd19717c3421929de05a7c8ac94;p=lttng-ust.git 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 --- 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) /*