| From f8dc9f790251562c3a4635edd29d7674298cd5f7 Mon Sep 17 00:00:00 2001 |
| From: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| Date: Sat, 4 May 2024 17:52:32 +0200 |
| Subject: [PATCH] core-sched.c: fix uclibc-ng build |
| |
| Since version 0.17.02 and commit |
| e75ecbc8994e94b9e151b1191c1888bd2821fe72, sched.h is not included before |
| including core-shim.h. The issue is that core-shim.h defines its own |
| sched_priority parameter in shim_sched_attr. When sched.h is included |
| after core-shim.h, the build will fail because __sched_priority will not |
| be found: |
| |
| In file included from core-sched.c:25: |
| core-sched.c: In function 'stress_set_sched': |
| core-sched.c:170:22: error: 'struct shim_sched_attr' has no member named '__sched_priority'; did you mean 'sched_priority'? |
| 170 | attr.sched_priority = (unsigned int)sched_priority; |
| | ^~~~~~~~~~~~~~ |
| |
| Fixes: |
| - http://autobuild.buildroot.org/results/d7d38dbb10f7f188da8dccc44a84a3c46a720bed |
| |
| Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| Upstream: https://github.com/ColinIanKing/stress-ng/commit/f8dc9f790251562c3a4635edd29d7674298cd5f7 |
| --- |
| core-shim.h | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| diff --git a/core-shim.h b/core-shim.h |
| index bed4cf2f6..475aac512 100644 |
| --- a/core-shim.h |
| +++ b/core-shim.h |
| @@ -23,6 +23,8 @@ |
| #include <sys/uio.h> |
| #endif |
| |
| +#include <sched.h> |
| + |
| /* |
| * BeagleBoneBlack with 4.1.15 kernel does not |
| * define the following, these should be defined |