1 From 713224456f4a3242496af803413f670433f27c74 Mon Sep 17 00:00:00 2001
2 From: Alexey Brodkin <abrodkin@synopsys.com>
3 Date: Mon, 10 Nov 2014 11:55:27 +0300
4 Subject: [PATCH] [PATCH] fix build with uClibc
6 Fix two build issues with (modern) uClibc:
7 - uClibc has clock_nanosleep() if built with UCLIBC_HAS_ADVANCED_REALTIME,
8 conflicting with emulation function
9 - uClibc doesn't provide utmpx.h if not built with UCLIBC_HAS_UTMPX, which
10 is included in several files (but not needed).
12 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
14 src/backfire/sendme.c | 1 -
15 src/cyclictest/cyclictest.c | 3 ++-
16 src/pmqtest/pmqtest.c | 1 -
17 src/ptsematest/ptsematest.c | 1 -
18 src/sigwaittest/sigwaittest.c | 2 --
19 src/svsematest/svsematest.c | 1 -
20 6 files changed, 2 insertions(+), 7 deletions(-)
22 diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c
23 index 8c169dd..b959951 100644
24 --- a/src/backfire/sendme.c
25 +++ b/src/backfire/sendme.c
28 #include "rt-get_cpu.h"
31 #include <sys/types.h>
34 diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
35 index 4547831..343e421 100644
36 --- a/src/cyclictest/cyclictest.c
37 +++ b/src/cyclictest/cyclictest.c
42 +#include <features.h>
44 #include <linux/unistd.h>
47 #define gettid() syscall(__NR_gettid)
48 #define sigev_notify_thread_id _sigev_un._tid
51 +#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_ADVANCED_REALTIME__)
52 #define MAKE_PROCESS_CPUCLOCK(pid, clock) \
53 ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
54 #define CPUCLOCK_SCHED 2
55 diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
56 index 336a8eb..2e34afe 100644
57 --- a/src/pmqtest/pmqtest.c
58 +++ b/src/pmqtest/pmqtest.c
62 #include <linux/unistd.h>
66 #include "rt-get_cpu.h"
67 diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
68 index 7558a41..5358a65 100644
69 --- a/src/ptsematest/ptsematest.c
70 +++ b/src/ptsematest/ptsematest.c
74 #include <linux/unistd.h>
77 #include "rt-get_cpu.h"
79 diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
80 index 428f5ce..85c32a2 100644
81 --- a/src/sigwaittest/sigwaittest.c
82 +++ b/src/sigwaittest/sigwaittest.c
88 #include <sys/types.h>
90 #include <linux/unistd.h>
93 #include "rt-get_cpu.h"
95 diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
96 index c1128cc..5d02550 100644
97 --- a/src/svsematest/svsematest.c
98 +++ b/src/svsematest/svsematest.c
105 #include <linux/unistd.h>