aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/stress-ng/stress-ng/0001-Several-changes-to-fix-musl-build.patch
blob: f90e704f05b1b8af0de3615304cbb77eb3f04db9 (plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
From d50203b233cb8820bf83b6651c2a8487e0db1fcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
Date: Tue, 17 Oct 2017 10:13:20 -0500
Subject: [PATCH] Several changes to fix musl build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

stress-{context, stackmmap}.c: Set tests to non-implemented because uses
swapcontext, musl provide the definition but not the implementation due
  to that functions are pre-POSIX and set to be deprecated.
  stress-{resources, pty}.c: Doesn't include termio.h and remove stress
  operations that uses struct termio, musl doesn't provide that struct.
stress-malloc.c: Check for definition of M_MMAP_THRESHOLD musl doesn't
  ptovide that constant.
stress-madvise.c: Add static poision_count integer, definition of
  MADV_SOFT_OFFLINE doesn't grauntee MADV_HWPOISON to be defined.
cache.c: Define GLOB_ONLYDIR not available on MUSL.

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>

Upstream-status: Pending
---
 cache.c            |  4 ++++
 stress-madvise.c   |  1 +
 stress-malloc.c    |  2 +-
 stress-pty.c       | 18 ------------------
 stress-resources.c |  1 -
 stress-stackmmap.c |  2 +-
 8 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/cache.c b/cache.c
index e01fad0..27870ee 100644
--- a/cache.c
+++ b/cache.c
@@ -27,6 +27,10 @@ typedef struct {
 
 #include <glob.h>
 
+#ifndef GLOB_ONLYDIR
+#define GLOB_ONLYDIR    0x100
+#endif
+
 #if defined(__linux__)
 #define SYS_CPU_PREFIX               "/sys/devices/system/cpu"
 #define GLOB_PATTERN SYS_CPU_PREFIX  "/cpu[0-9]*"
diff --git a/stress-madvise.c b/stress-madvise.c
index 43ea454..2e1f8ee 100644
--- a/stress-madvise.c
+++ b/stress-madvise.c
@@ -141,6 +141,7 @@ static int stress_random_advise(const args_t *args)
 #if defined(MADV_SOFT_OFFLINE)
 	if (advise == MADV_SOFT_OFFLINE) {
 		static int soft_offline_count;
+		static int poison_count;
 
 		/* ..and minimize number of soft offline pages */
 		if ((soft_offline_count >= NUM_SOFT_OFFLINE_MAX) ||
diff --git a/stress-malloc.c b/stress-malloc.c
index 8dbe5cc..f505f32 100644
--- a/stress-malloc.c
+++ b/stress-malloc.c
@@ -99,7 +99,7 @@ int stress_malloc(const args_t *args)
 			malloc_max = MIN_MALLOC_MAX;
 	}
 
-#if defined(__GNUC__) && defined(__linux__)
+#if defined(__GNUC__) && defined(__linux__) && defined(M_MMAP_THRESHOLD)
 	if (get_setting("malloc-threshold", &malloc_threshold))
 		(void)mallopt(M_MMAP_THRESHOLD, (int)malloc_threshold);
 #endif
diff --git a/stress-pty.c b/stress-pty.c
index 8c3edf8..518f118 100644
--- a/stress-pty.c
+++ b/stress-pty.c
@@ -26,7 +26,6 @@
 
 #if defined(__linux__)
 
-#include <termio.h>
 #include <termios.h>
 
 typedef struct {
@@ -108,7 +107,6 @@ int stress_pty(const args_t *args)
 		 */
 		for (i = 0; i < n; i++) {
 			struct termios ios;
-			struct termio io;
 			struct winsize ws;
 			int arg;
 
@@ -130,22 +128,6 @@ int stress_pty(const args_t *args)
 			if (ioctl(ptys[i].slave, TCSETSF, &ios) < 0)
 				pr_fail_err("ioctl TCSETSF on slave pty");
 #endif
-#if defined(TCGETA)
-			if (ioctl(ptys[i].slave, TCGETA, &io) < 0)
-				pr_fail_err("ioctl TCGETA on slave pty");
-#endif
-#if defined(TCSETA)
-			if (ioctl(ptys[i].slave, TCSETA, &io) < 0)
-				pr_fail_err("ioctl TCSETA on slave pty");
-#endif
-#if defined(TCSETAW)
-			if (ioctl(ptys[i].slave, TCSETAW, &io) < 0)
-				pr_fail_err("ioctl TCSETAW on slave pty");
-#endif
-#if defined(TCSETAF)
-			if (ioctl(ptys[i].slave, TCSETAF, &io) < 0)
-				pr_fail_err("ioctl TCSETAF on slave pty");
-#endif
 #if defined(TIOCGLCKTRMIOS)
 			if (ioctl(ptys[i].slave, TIOCGLCKTRMIOS, &ios) < 0)
 				pr_fail_err("ioctl TIOCGLCKTRMIOS on slave pty");
diff --git a/stress-resources.c b/stress-resources.c
index 182e176..880433d 100644
--- a/stress-resources.c
+++ b/stress-resources.c
@@ -31,7 +31,6 @@
 #include <sys/inotify.h>
 #endif
 #if defined(__linux__)
-#include <termio.h>
 #include <termios.h>
 #endif
 #if defined(HAVE_LIB_PTHREAD) && defined(__linux__)
diff --git a/stress-stackmmap.c b/stress-stackmmap.c
index e1378e2..00d1268 100644
--- a/stress-stackmmap.c
+++ b/stress-stackmmap.c
@@ -24,7 +24,7 @@
  */
 #include "stress-ng.h"
 
-#if defined(__linux__)
+#if defined(__linux__) && False
 
 #include <ucontext.h>
 
-- 
2.11.0