From 62892051046c6363184991dfa6ff45e93cc71330 Mon Sep 17 00:00:00 2001 From: cuiziwei Date: Fri, 4 Aug 2023 17:31:31 +0800 Subject: [PATCH] sched: Define sched_getcpu return 0 when CONFIG_SMP equals n Signed-off-by: cuiziwei --- include/sched.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sched.h b/include/sched.h index f1b77408bd..968268db4d 100644 --- a/include/sched.h +++ b/include/sched.h @@ -253,6 +253,8 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize, int sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask); int sched_cpucount(FAR const cpu_set_t *set); int sched_getcpu(void); +#else +# define sched_getcpu() 0 #endif /* CONFIG_SMP */ /* Task Switching Interfaces (non-standard) */