1 From cca93ce25f993c97ef3d96fa32461d5717c30518 Mon Sep 17 00:00:00 2001
2 From: Luca Ceresoli <luca@lucaceresoli.net>
3 Date: Sat, 12 Mar 2016 15:31:47 +0100
4 Subject: [PATCH 2/2] Replace __sched_priority with sched_priority(fixes musl
7 The musl C library defines sched_priority, not __sched_priority as GNU
8 libc and uClibc-ng do. Use sched_priority instead.
10 This does not break compatibility with GNU libc and uClibc-ng because
11 both define in sched.h:
13 #define sched_priority __sched_priority
15 Fixes the following build errors when building with musl:
17 ../src/samples/siprtp.c: In function 'boost_priority':
18 ../src/samples/siprtp.c:1137:7: error: 'struct sched_param' has no member named '__sched_priority'
19 tp.__sched_priority = max_prio;
21 In file included from /home/murray/devel/buildroot/test-musl-eabi/build/libpjsip-2.4.5/pjlib/include/pj/except.h:30:0,
22 from /home/murray/devel/buildroot/test-musl-eabi/build/libpjsip-2.4.5/pjlib/include/pjlib.h:35,
23 from ../src/samples/siprtp.c:76:
24 ../src/samples/siprtp.c:1146:18: error: 'struct sched_param' has no member named '__sched_priority'
25 policy, tp.__sched_priority));
29 http://git.alpinelinux.org/cgit/aports/plain/main/pjproject/musl-fixes.patch
31 Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
33 pjsip-apps/src/samples/siprtp.c | 10 +++++-----
34 1 file changed, 5 insertions(+), 5 deletions(-)
36 diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c
37 index 796464f..6e32a8f 100644
38 --- a/pjsip-apps/src/samples/siprtp.c
39 +++ b/pjsip-apps/src/samples/siprtp.c
40 @@ -1134,7 +1134,7 @@ static void boost_priority(void)
41 PJ_RETURN_OS_ERROR(rc));
44 - tp.__sched_priority = max_prio;
45 + tp.sched_priority = max_prio;
47 rc = sched_setscheduler(0, POLICY, &tp);
49 @@ -1143,7 +1143,7 @@ static void boost_priority(void)
52 PJ_LOG(4, (THIS_FILE, "New process policy=%d, priority=%d",
53 - policy, tp.__sched_priority));
54 + policy, tp.sched_priority));
57 * Adjust thread scheduling algorithm and priority
58 @@ -1156,10 +1156,10 @@ static void boost_priority(void)
61 PJ_LOG(4, (THIS_FILE, "Old thread policy=%d, priority=%d",
62 - policy, tp.__sched_priority));
63 + policy, tp.sched_priority));
66 - tp.__sched_priority = max_prio;
67 + tp.sched_priority = max_prio;
69 rc = pthread_setschedparam(pthread_self(), policy, &tp);
71 @@ -1169,7 +1169,7 @@ static void boost_priority(void)
74 PJ_LOG(4, (THIS_FILE, "New thread policy=%d, priority=%d",
75 - policy, tp.__sched_priority));
76 + policy, tp.sched_priority));