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