summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch39
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch31
-rw-r--r--meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch394
-rw-r--r--meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch270
-rw-r--r--meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch35
-rw-r--r--meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch77
-rw-r--r--meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch70
-rw-r--r--meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch351
-rw-r--r--meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch67
-rw-r--r--meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch56
-rw-r--r--meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch64
-rw-r--r--meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch45
-rw-r--r--meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch88
-rw-r--r--meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch29
-rw-r--r--meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch23
-rw-r--r--meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch32
-rw-r--r--meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch26
-rw-r--r--meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch33
-rw-r--r--meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch30
-rw-r--r--meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch27
-rw-r--r--meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch50
-rw-r--r--meta/recipes-extended/ltp/ltp/0038-run-posix-option-group-test-replace-CWD-qith-PWD.patch44
-rw-r--r--meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch17
-rw-r--r--meta/recipes-extended/ltp/ltp/0040-containers-userns05-use-unsigned-int-for-ns-id.patch60
-rw-r--r--meta/recipes-extended/ltp/ltp_20170116.bb (renamed from meta/recipes-extended/ltp/ltp_20160126.bb)35
29 files changed, 306 insertions, 1809 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch b/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
new file mode 100644
index 0000000000..7ec66f8147
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-add-_GNU_SOURCE-to-pec_listener.c.patch
@@ -0,0 +1,39 @@
1From ae10245c15a617bd57337981bb42eb36629f9b59 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 8 Feb 2017 15:53:31 +0800
4Subject: [PATCH 01/26] add _GNU_SOURCE to pec_listener.c
5
6In previous patch 0007-replace-SIGCLD-with-SIGCHLD.patch made by Khem Raj
7contains two aspects:
8
9 1. replace SIGCLD with SIGCHLD
10 2. add _GNU_SOURCE to pec_listener.c
11
12The replace SIGCLD with SIGCHLD have been integrated upstream, so make a
13another patch to add _GNU_SOURCE to pec_listener.c comply with Khem Raj's
14previous patch.
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Dengke Du <dengke.du@windriver.com>
18Upstream-Status: Pending
19
20%% original patch: 0001-add-_GNU_SOURCE-to-pec_listener.c.patch
21---
22 testcases/kernel/connectors/pec/pec_listener.c | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
26index d11e4dc..b8b5e0d 100644
27--- a/testcases/kernel/connectors/pec/pec_listener.c
28+++ b/testcases/kernel/connectors/pec/pec_listener.c
29@@ -20,6 +20,7 @@
30 /* */
31 /******************************************************************************/
32
33+#define _GNU_SOURCE
34 #include <sys/socket.h>
35 #include <sys/poll.h>
36 #include <sys/types.h>
37--
382.8.1
39
diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
deleted file mode 100644
index 585b7cbc6a..0000000000
--- a/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001
2From: Chong Lu <Chong.Lu@windriver.com>
3Date: Tue, 11 Mar 2014 14:47:22 +0800
4Subject: [PATCH 01/32] ltp: Don't link against libfl
5
6We have already defined yywrap function in scan.l file. After this, we no longer need to
7link against libfl and so no longer get errors about undefined references to yylex.
8
9Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 pan/Makefile | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/pan/Makefile b/pan/Makefile
16index 4cc6466..a4b575b 100644
17--- a/pan/Makefile
18+++ b/pan/Makefile
19@@ -31,7 +31,7 @@ CPPFLAGS += -Wno-error
20
21 CPPFLAGS += -I$(abs_srcdir)
22
23-LDLIBS += -lm $(LEXLIB)
24+LDLIBS += -lm
25
26 LFLAGS += -l
27
28--
292.7.0
30
diff --git a/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch b/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch
new file mode 100644
index 0000000000..8874b95749
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch
@@ -0,0 +1,30 @@
1From 32644bde4d33b677614534ec37030e57883b8e15 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 9 Feb 2017 16:41:12 +0800
4Subject: [PATCH 1/3] fix PATH_MAX undeclared when building with musl
5
6fix PATH_MAX undeclared when building with musl.
7
8Signed-off-by: Dengke Du <dengke.du@windriver.com>
9Upstream-Status: Pending
10---
11 include/tst_test.h | 3 +++
12 1 file changed, 3 insertions(+)
13
14diff --git a/include/tst_test.h b/include/tst_test.h
15index 7ff33b2..9779c0e 100644
16--- a/include/tst_test.h
17+++ b/include/tst_test.h
18@@ -19,6 +19,9 @@
19 #define TST_TEST_H__
20
21 #include <unistd.h>
22+#ifndef __GLIBC__
23+#include <limits.h>
24+#endif
25
26 #include "tst_common.h"
27 #include "tst_res_flags.h"
28--
292.7.4
30
diff --git a/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch b/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
deleted file mode 100644
index 56a48abcc9..0000000000
--- a/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 18:24:20 +0000
4Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t
5
6__off64_t is specific to glibc where as off64_t is widely available
7Add _GNU_SOURCE for off64_t defines from sys/types.h
8Fixes
9<command-line>:0:7: error: unknown type name 'off64_t'
10sendfile02.c:97:18: note: in expansion of macro 'OFF_T'
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 testcases/kernel/syscalls/sendfile/Makefile | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile
18index df7b63f..1bd1b57 100644
19--- a/testcases/kernel/syscalls/sendfile/Makefile
20+++ b/testcases/kernel/syscalls/sendfile/Makefile
21@@ -21,6 +21,6 @@ top_srcdir ?= ../../../..
22 include $(top_srcdir)/include/mk/testcases.mk
23 include $(abs_srcdir)/../utils/newer_64.mk
24
25-%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t
26+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE
27
28 include $(top_srcdir)/include/mk/generic_leaf_target.mk
29--
302.7.0
31
diff --git a/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
new file mode 100644
index 0000000000..8d0e73992f
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
@@ -0,0 +1,30 @@
1From a2639bd0f0d3f9f3049ee33e6710fed06225f54f Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 9 Feb 2017 18:20:58 +0800
4Subject: [PATCH 1/2] fix __WORDSIZE undeclared when building with musl
5
6fix __WORDSIZE undeclared when building with musl.
7
8Signed-off-by: Dengke Du <dengke.du@windriver.com>
9Upstream-Status: Pending
10---
11 include/old/test.h | 3 +++
12 1 file changed, 3 insertions(+)
13
14diff --git a/include/old/test.h b/include/old/test.h
15index d492560..263e92e 100644
16--- a/include/old/test.h
17+++ b/include/old/test.h
18@@ -58,6 +58,9 @@
19 #include "tst_clone.h"
20 #include "old_device.h"
21 #include "old_tmpdir.h"
22+#ifndef __GLIBC__
23+#include <bits/reg.h>
24+#endif
25
26 /*
27 * Ensure that NUMSIGS is defined.
28--
292.7.4
30
diff --git a/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch b/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
deleted file mode 100644
index 4be906ec78..0000000000
--- a/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
+++ /dev/null
@@ -1,394 +0,0 @@
1From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:33:53 +0000
4Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD
5
6its defined to use SIGCHLD anyway in
7
8bits/signum.h:#define SIGCLD SIGCHLD /* Same as SIGCHLD
9(System V). */
10
11plus it helps these tests compile with musl which adheres to posix
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 lib/tst_sig.c | 8 ++++----
16 testcases/kernel/connectors/pec/pec_listener.c | 1 +
17 testcases/kernel/fs/doio/doio.c | 4 ++--
18 testcases/kernel/fs/doio/growfiles.c | 2 +-
19 testcases/kernel/syscalls/fcntl/fcntl11.c | 8 ++++----
20 testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++++----
21 testcases/kernel/syscalls/fcntl/fcntl19.c | 8 ++++----
22 testcases/kernel/syscalls/fcntl/fcntl20.c | 8 ++++----
23 testcases/kernel/syscalls/fcntl/fcntl21.c | 8 ++++----
24 testcases/kernel/syscalls/kill/kill02.c | 6 +++---
25 testcases/kernel/syscalls/kill/kill12.c | 8 ++++----
26 testcases/kernel/syscalls/mkdir/mkdir09.c | 12 ++++++------
27 testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
28 testcases/network/tcp_cmds/perf_lan/pingpong.c | 2 +-
29 testcases/network/tcp_cmds/perf_lan/pingpong6.c | 2 +-
30 15 files changed, 44 insertions(+), 43 deletions(-)
31
32diff --git a/lib/tst_sig.c b/lib/tst_sig.c
33index 3af5ffd..36565e1 100644
34--- a/lib/tst_sig.c
35+++ b/lib/tst_sig.c
36@@ -49,7 +49,7 @@
37 fork_flag - set to FORK or NOFORK depending upon whether the
38 calling program executes a fork() system call. It
39 is normally the case that the calling program treats
40- SIGCLD as an expected signal if fork() is being used.
41+ SIGCHLD as an expected signal if fork() is being used.
42
43 handler - a pointer to the unexpected signal handler to
44 be executed after an unexpected signal has been
45@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int);
46
47 /****************************************************************************
48 * tst_sig() : set-up to catch unexpected signals. fork_flag is set to NOFORK
49- * if SIGCLD is to be an "unexpected signal", otherwise it is set to
50+ * if SIGCHLD is to be an "unexpected signal", otherwise it is set to
51 * FORK. cleanup points to a cleanup routine to be executed before
52 * tst_exit is called (cleanup is set to NULL if no cleanup is desired).
53 * handler is a pointer to the signal handling routine (if handler is
54@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
55 for (sig = 1; sig < NSIG; sig++) {
56 /*
57 * SIGKILL is never unexpected.
58- * SIGCLD is only unexpected when
59+ * SIGCHLD is only unexpected when
60 * no forking is being done.
61 * SIGINFO is used for file quotas and should be expected
62 */
63@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
64 #endif
65 break;
66
67- case SIGCLD:
68+ case SIGCHLD:
69 if (fork_flag == FORK)
70 continue;
71
72diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
73index a1beb13..002750a 100644
74--- a/testcases/kernel/connectors/pec/pec_listener.c
75+++ b/testcases/kernel/connectors/pec/pec_listener.c
76@@ -20,6 +20,7 @@
77 /* */
78 /******************************************************************************/
79
80+#define _GNU_SOURCE
81 #include <sys/socket.h>
82 #include <sys/poll.h>
83 #include <sys/types.h>
84diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c
85index 4b0dec5..5f65ef9 100644
86--- a/testcases/kernel/fs/doio/doio.c
87+++ b/testcases/kernel/fs/doio/doio.c
88@@ -573,7 +573,7 @@ int main(int argc, char **argv)
89 case SIGTSTP:
90 case SIGSTOP:
91 case SIGCONT:
92- case SIGCLD:
93+ case SIGCHLD:
94 case SIGBUS:
95 case SIGSEGV:
96 case SIGQUIT:
97@@ -615,7 +615,7 @@ int main(int argc, char **argv)
98 }
99
100 sigemptyset(&block_mask);
101- sigaddset(&block_mask, SIGCLD);
102+ sigaddset(&block_mask, SIGCHLD);
103 sigprocmask(SIG_BLOCK, &block_mask, &omask);
104
105 /*
106diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
107index 09e7f35..bbad230 100644
108--- a/testcases/kernel/fs/doio/growfiles.c
109+++ b/testcases/kernel/fs/doio/growfiles.c
110@@ -1640,7 +1640,7 @@ int set_sig(void)
111 #ifdef SIGRESTART
112 case SIGRESTART:
113 #endif /* SIGRESTART */
114- case SIGCLD:
115+ case SIGCHLD:
116 break;
117
118 default:
119diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
120index fa6ce53..2de2b6c 100644
121--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
122+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
123@@ -105,10 +105,10 @@ void setup(void)
124 memset(&act, 0, sizeof(act));
125 act.sa_handler = catch_child;
126 sigemptyset(&act.sa_mask);
127- sigaddset(&act.sa_mask, SIGCLD);
128- if ((sigaction(SIGCLD, &act, NULL)) < 0)
129+ sigaddset(&act.sa_mask, SIGCHLD);
130+ if ((sigaction(SIGCHLD, &act, NULL)) < 0)
131 tst_brkm(TBROK | TERRNO, cleanup,
132- "sigaction(SIGCLD, ..) failed");
133+ "sigaction(SIGCHLD, ..) failed");
134 }
135
136 void do_child(void)
137@@ -227,7 +227,7 @@ void stop_child(void)
138 {
139 struct flock fl;
140
141- signal(SIGCLD, SIG_DFL);
142+ signal(SIGCHLD, SIG_DFL);
143 fl.l_type = STOP;
144 parent_put(&fl);
145 wait(0);
146diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
147index 5b03e39..6598b20 100644
148--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
149+++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
150@@ -150,9 +150,9 @@ int setup(void)
151 memset(&act, 0, sizeof(act));
152 act.sa_handler = catch_child;
153 sigemptyset(&act.sa_mask);
154- sigaddset(&act.sa_mask, SIGCLD);
155- if (sigaction(SIGCLD, &act, NULL) < 0) {
156- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
157+ sigaddset(&act.sa_mask, SIGCHLD);
158+ if (sigaction(SIGCHLD, &act, NULL) < 0) {
159+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
160 return 1;
161 }
162 return 0;
163@@ -381,7 +381,7 @@ void stop_children(void)
164 {
165 int arg;
166
167- signal(SIGCLD, SIG_DFL);
168+ signal(SIGCHLD, SIG_DFL);
169 arg = STOP;
170 child_free(child_pipe1[1], arg);
171 child_free(child_pipe2[1], arg);
172diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
173index a542cfc..88c91d6 100644
174--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
175+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
176@@ -112,9 +112,9 @@ void setup(void)
177 memset(&act, 0, sizeof(act));
178 act.sa_handler = catch_child;
179 sigemptyset(&act.sa_mask);
180- sigaddset(&act.sa_mask, SIGCLD);
181- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
182- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
183+ sigaddset(&act.sa_mask, SIGCHLD);
184+ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
185+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
186 fail = 1;
187 }
188 }
189@@ -265,7 +265,7 @@ void stop_child(void)
190 {
191 struct flock fl;
192
193- signal(SIGCLD, SIG_DFL);
194+ signal(SIGCHLD, SIG_DFL);
195 fl.l_type = STOP;
196 parent_put(&fl);
197 wait(0);
198diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
199index aa06bab..99fd783 100644
200--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
201+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
202@@ -109,9 +109,9 @@ void setup(void)
203 memset(&act, 0, sizeof(act));
204 act.sa_handler = catch_child;
205 sigemptyset(&act.sa_mask);
206- sigaddset(&act.sa_mask, SIGCLD);
207- if (sigaction(SIGCLD, &act, NULL) == -1)
208- tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed");
209+ sigaddset(&act.sa_mask, SIGCHLD);
210+ if (sigaction(SIGCHLD, &act, NULL) == -1)
211+ tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed");
212 }
213
214 void cleanup(void)
215@@ -264,7 +264,7 @@ void stop_child(void)
216 {
217 struct flock fl;
218
219- signal(SIGCLD, SIG_DFL);
220+ signal(SIGCHLD, SIG_DFL);
221 fl.l_type = STOP;
222 parent_put(&fl);
223 wait(0);
224diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
225index 5307021..8f1a67c 100644
226--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
227+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
228@@ -110,9 +110,9 @@ void setup(void)
229 memset(&act, 0, sizeof(act));
230 act.sa_handler = catch_child;
231 sigemptyset(&act.sa_mask);
232- sigaddset(&act.sa_mask, SIGCLD);
233- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
234- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
235+ sigaddset(&act.sa_mask, SIGCHLD);
236+ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
237+ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
238 fail = 1;
239 }
240 }
241@@ -272,7 +272,7 @@ void stop_child(void)
242 {
243 struct flock fl;
244
245- signal(SIGCLD, SIG_DFL);
246+ signal(SIGCHLD, SIG_DFL);
247 fl.l_type = STOP;
248 parent_put(&fl);
249 wait(0);
250diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
251index 9d6cc68..08360dd 100644
252--- a/testcases/kernel/syscalls/kill/kill02.c
253+++ b/testcases/kernel/syscalls/kill/kill02.c
254@@ -701,7 +701,7 @@ void setup(void)
255
256 /*
257 * Set to catch unexpected signals.
258- * SIGCLD is set to be ignored because we do not wait for termination status.
259+ * SIGCHLD is set to be ignored because we do not wait for termination status.
260 * SIGUSR1 is set to be ignored because this is the signal we are using for
261 * the test and we are not concerned with the parent getting it.
262 */
263@@ -713,9 +713,9 @@ void setup(void)
264 "signal(SIGUSR1, SIG_IGN) failed");
265 }
266
267- if (signal(SIGCLD, SIG_IGN) == SIG_ERR) {
268+ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
269 tst_brkm(TBROK | TERRNO, NULL,
270- "signal(SIGCLD, SIG_IGN) failed");
271+ "signal(SIGCHLD, SIG_IGN) failed");
272 }
273
274 TEST_PAUSE;
275diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
276index 7a47a4a..d7c4147 100644
277--- a/testcases/kernel/syscalls/kill/kill12.c
278+++ b/testcases/kernel/syscalls/kill/kill12.c
279@@ -98,7 +98,7 @@ int main(int argc, char **argv)
280
281 exno = 1;
282
283- if (sigset(SIGCLD, chsig) == SIG_ERR) {
284+ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
285 fprintf(temp, "\tsigset failed, errno = %d\n", errno);
286 fail_exit();
287 }
288@@ -128,7 +128,7 @@ int main(int argc, char **argv)
289 sleep(1);
290
291 kill(pid, sig); /* child should ignroe this sig */
292- kill(pid, SIGCLD); /* child should exit */
293+ kill(pid, SIGCHLD); /* child should exit */
294
295 #ifdef BCS
296 while ((npid = wait(&status)) != pid
297@@ -222,14 +222,14 @@ void do_child(void)
298 int exno = 1;
299
300 #ifdef UCLINUX
301- if (sigset(SIGCLD, chsig) == SIG_ERR) {
302+ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
303 fprintf(temp, "\tsigset failed, errno = %d\n", errno);
304 fail_exit();
305 }
306 #endif
307
308 sigset(sig, SIG_IGN); /* set to ignore signal */
309- kill(getppid(), SIGCLD); /* tell parent we are ready */
310+ kill(getppid(), SIGCHLD); /* tell parent we are ready */
311 while (!chflag)
312 sleep(1); /* wait for parent */
313
314diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
315index 41c20e9..07b4fb8 100644
316--- a/testcases/kernel/syscalls/mkdir/mkdir09.c
317+++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
318@@ -122,10 +122,10 @@ int main(int argc, char *argv[])
319
320 }
321
322- /* Set up to catch SIGCLD signal */
323- if (signal(SIGCLD, chld) == SIG_ERR) {
324+ /* Set up to catch SIGCHLD signal */
325+ if (signal(SIGCHLD, chld) == SIG_ERR) {
326 tst_brkm(TFAIL, cleanup,
327- "Error setting up SIGCLD signal, ERRNO = %d", errno);
328+ "Error setting up SIGCHLD signal, ERRNO = %d", errno);
329
330 }
331
332@@ -236,9 +236,9 @@ int runtest(void)
333 tst_brkm(TFAIL, cleanup,
334 "Error resetting SIGTERM signal, ERRNO = %d", errno);
335 }
336- if (signal(SIGCLD, SIG_DFL) == SIG_ERR) {
337+ if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
338 tst_brkm(TFAIL, cleanup,
339- "Error resetting SIGCLD signal, ERRNO = %d", errno);
340+ "Error resetting SIGCHLD signal, ERRNO = %d", errno);
341 }
342
343 if (test_time) {
344@@ -372,7 +372,7 @@ void term(int sig)
345
346 void chld(int sig)
347 {
348- /* Routine to handle SIGCLD signal. */
349+ /* Routine to handle SIGCHLD signal. */
350
351 sigchld++;
352 if (jump) {
353diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
354index e3076fb..be01874 100644
355--- a/testcases/kernel/syscalls/sighold/sighold02.c
356+++ b/testcases/kernel/syscalls/sighold/sighold02.c
357@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS];
358 static int skip_sig(int sig)
359 {
360 switch (sig) {
361- case SIGCLD:
362+ case SIGCHLD:
363 case SIGKILL:
364 case SIGALRM:
365 case SIGSTOP:
366diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c
367index 1196312..5b06798 100644
368--- a/testcases/network/tcp_cmds/perf_lan/pingpong.c
369+++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c
370@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
371
372 /* Setup traps */
373 signal(SIGINT, finish);
374- signal(SIGCLD, finish);
375+ signal(SIGCHLD, finish);
376
377 /* Fork a child process to continue sending packets */
378 tst_resm(TINFO, "Create a child process to continue to send packets");
379diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
380index 9747f58..0a0fb1d 100644
381--- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c
382+++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
383@@ -153,7 +153,7 @@ char *argv[];
384
385 /* Setup traps */
386 signal(SIGINT, finish);
387- signal(SIGCLD, finish);
388+ signal(SIGCHLD, finish);
389
390 /* Fork a child process to continue sending packets */
391 printf("Create a child process to continue to send packets \n");
392--
3932.7.0
394
diff --git a/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch b/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
deleted file mode 100644
index e58e5a96b0..0000000000
--- a/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
+++ /dev/null
@@ -1,270 +0,0 @@
1From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:45:35 +0000
4Subject: [PATCH 09/32] Guard error.h with __GLIBC__
5
6error API is specific to glibc so use the guard to make it conditional
7on glibc
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/syscalls/faccessat/faccessat01.c | 2 ++
12 testcases/kernel/syscalls/fallocate/fallocate01.c | 2 ++
13 testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 ++
14 testcases/kernel/syscalls/fchownat/fchownat01.c | 2 ++
15 testcases/kernel/syscalls/fchownat/fchownat02.c | 2 ++
16 testcases/kernel/syscalls/fstatat/fstatat01.c | 2 ++
17 testcases/kernel/syscalls/futimesat/futimesat01.c | 2 ++
18 testcases/kernel/syscalls/linkat/linkat01.c | 2 ++
19 testcases/kernel/syscalls/linkat/linkat02.c | 2 ++
20 testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 ++
21 testcases/kernel/syscalls/mknodat/mknodat01.c | 2 ++
22 testcases/kernel/syscalls/mknodat/mknodat02.c | 2 ++
23 testcases/kernel/syscalls/openat/openat01.c | 2 ++
24 testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++
25 testcases/kernel/syscalls/renameat/renameat01.c | 2 ++
26 testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 ++
27 testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 ++
28 17 files changed, 34 insertions(+)
29
30diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
31index 7f0e87a..c72dcf0 100644
32--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
33+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
34@@ -37,7 +37,9 @@
35 #include <sys/stat.h>
36 #include <fcntl.h>
37 #include <unistd.h>
38+#ifdef __GLIBC__
39 #include <error.h>
40+#endif
41 #include <stdlib.h>
42 #include <errno.h>
43 #include <string.h>
44diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
45index e72b123..643c0e2 100644
46--- a/testcases/kernel/syscalls/fallocate/fallocate01.c
47+++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
48@@ -96,7 +96,9 @@
49 #include <fcntl.h>
50 #include <sys/syscall.h>
51 #include <unistd.h>
52+#ifdef __GLIBC__
53 #include <error.h>
54+#endif
55 #include <inttypes.h>
56 #include <sys/utsname.h>
57
58diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
59index 19e9ad5..ae6d807 100644
60--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
61+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
62@@ -37,7 +37,9 @@
63 #include <sys/stat.h>
64 #include <fcntl.h>
65 #include <unistd.h>
66+#ifdef __GLIBC__
67 #include <error.h>
68+#endif
69 #include <stdlib.h>
70 #include <errno.h>
71 #include <string.h>
72diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
73index b361253..a5218af 100644
74--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
75+++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
76@@ -28,7 +28,9 @@
77 #include <sys/stat.h>
78 #include <fcntl.h>
79 #include <unistd.h>
80+#ifdef __GLIBC__
81 #include <error.h>
82+#endif
83 #include <stdlib.h>
84 #include <errno.h>
85 #include <string.h>
86diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c
87index 6b0304c..8d2863f 100644
88--- a/testcases/kernel/syscalls/fchownat/fchownat02.c
89+++ b/testcases/kernel/syscalls/fchownat/fchownat02.c
90@@ -26,7 +26,9 @@
91 #include <sys/stat.h>
92 #include <fcntl.h>
93 #include <unistd.h>
94+#ifdef __GLIBC__
95 #include <error.h>
96+#endif
97 #include <stdlib.h>
98 #include <errno.h>
99 #include <string.h>
100diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
101index 61531c6..e99fbd2 100644
102--- a/testcases/kernel/syscalls/fstatat/fstatat01.c
103+++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
104@@ -48,7 +48,9 @@
105 #include <sys/stat.h>
106 #include <sys/time.h>
107 #include <fcntl.h>
108+#ifdef __GLIBC__
109 #include <error.h>
110+#endif
111 #include <stdlib.h>
112 #include <errno.h>
113 #include <string.h>
114diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
115index ae8d4fe..316dd78 100644
116--- a/testcases/kernel/syscalls/futimesat/futimesat01.c
117+++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
118@@ -37,7 +37,9 @@
119 #include <sys/stat.h>
120 #include <sys/time.h>
121 #include <fcntl.h>
122+#ifdef __GLIBC__
123 #include <error.h>
124+#endif
125 #include <stdlib.h>
126 #include <errno.h>
127 #include <string.h>
128diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
129index fc0687b..83cbfe7 100644
130--- a/testcases/kernel/syscalls/linkat/linkat01.c
131+++ b/testcases/kernel/syscalls/linkat/linkat01.c
132@@ -49,7 +49,9 @@
133 #include <sys/time.h>
134 #include <fcntl.h>
135 #include <unistd.h>
136+#ifdef __GLIBC__
137 #include <error.h>
138+#endif
139 #include <stdlib.h>
140 #include <errno.h>
141 #include <string.h>
142diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c
143index e9a752a..8d7e431 100644
144--- a/testcases/kernel/syscalls/linkat/linkat02.c
145+++ b/testcases/kernel/syscalls/linkat/linkat02.c
146@@ -23,7 +23,9 @@
147 #include <sys/stat.h>
148 #include <fcntl.h>
149 #include <unistd.h>
150+#ifdef __GLIBC__
151 #include <error.h>
152+#endif
153 #include <stdlib.h>
154 #include <errno.h>
155 #include <string.h>
156diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
157index 7e15947..1dbc038 100644
158--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
159+++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
160@@ -30,7 +30,9 @@
161 #include <sys/types.h>
162 #include <sys/stat.h>
163 #include <fcntl.h>
164+#ifdef __GLIBC__
165 #include <error.h>
166+#endif
167 #include <stdlib.h>
168 #include <errno.h>
169 #include <string.h>
170diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
171index 26e5538..f034f05 100644
172--- a/testcases/kernel/syscalls/mknodat/mknodat01.c
173+++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
174@@ -29,7 +29,9 @@
175 #include <sys/types.h>
176 #include <fcntl.h>
177 #include <sys/stat.h>
178+#ifdef __GLIBC__
179 #include <error.h>
180+#endif
181 #include <stdlib.h>
182 #include <errno.h>
183 #include <string.h>
184diff --git a/testcases/kernel/syscalls/mknodat/mknodat02.c b/testcases/kernel/syscalls/mknodat/mknodat02.c
185index f6368fa..7d0f7c0 100644
186--- a/testcases/kernel/syscalls/mknodat/mknodat02.c
187+++ b/testcases/kernel/syscalls/mknodat/mknodat02.c
188@@ -29,7 +29,9 @@
189 #include <sys/types.h>
190 #include <fcntl.h>
191 #include <sys/stat.h>
192+#ifdef __GLIBC__
193 #include <error.h>
194+#endif
195 #include <stdlib.h>
196 #include <errno.h>
197 #include <string.h>
198diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
199index 85f9a91..4ee0117 100644
200--- a/testcases/kernel/syscalls/openat/openat01.c
201+++ b/testcases/kernel/syscalls/openat/openat01.c
202@@ -29,7 +29,9 @@
203 #include <sys/types.h>
204 #include <sys/stat.h>
205 #include <fcntl.h>
206+#ifdef __GLIBC__
207 #include <error.h>
208+#endif
209 #include <stdlib.h>
210 #include <errno.h>
211 #include <string.h>
212diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
213index 97a49e8..b162853 100644
214--- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
215+++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
216@@ -29,7 +29,9 @@
217 #include <sys/stat.h>
218 #include <sys/time.h>
219 #include <fcntl.h>
220+#ifdef __GLIBC__
221 #include <error.h>
222+#endif
223 #include <stdlib.h>
224 #include <errno.h>
225 #include <string.h>
226diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
227index f4cd51b..105a05b 100644
228--- a/testcases/kernel/syscalls/renameat/renameat01.c
229+++ b/testcases/kernel/syscalls/renameat/renameat01.c
230@@ -42,7 +42,9 @@
231 #include <sys/stat.h>
232 #include <sys/time.h>
233 #include <fcntl.h>
234+#ifdef __GLIBC__
235 #include <error.h>
236+#endif
237 #include <stdlib.h>
238 #include <errno.h>
239 #include <string.h>
240diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
241index 5c238d8..cb7a7e8 100644
242--- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
243+++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
244@@ -37,7 +37,9 @@
245 #include <sys/stat.h>
246 #include <sys/time.h>
247 #include <fcntl.h>
248+#ifdef __GLIBC__
249 #include <error.h>
250+#endif
251 #include <stdlib.h>
252 #include <errno.h>
253 #include <string.h>
254diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
255index 31fe4e7..26f6d9a 100644
256--- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
257+++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
258@@ -37,7 +37,9 @@
259 #include <sys/stat.h>
260 #include <sys/time.h>
261 #include <fcntl.h>
262+#ifdef __GLIBC__
263 #include <error.h>
264+#endif
265 #include <stdlib.h>
266 #include <errno.h>
267 #include <string.h>
268--
2692.7.0
270
diff --git a/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
new file mode 100644
index 0000000000..6886c55e72
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
@@ -0,0 +1,35 @@
1From 2d7ea67e8eaa41cbd6816f7ab654254b40b530a1 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 9 Feb 2017 17:17:37 +0800
4Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl
5
6When building with musl the file "sys/msg.h" already contain 'struct msgbuf'
7
8Signed-off-by: Dengke Du <dengke.du@windriver.com>
9Upstream-Status: Pending
10---
11 testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
15index a757c0d..e023114 100644
16--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
17+++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
18@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08";
19 const int TST_TOTAL = 1;
20
21 #if __WORDSIZE == 32
22-
23+#ifdef __GLIBC__
24 struct msgbuf {
25 long mtype; /* message type, must be > 0 */
26 char mtext[16]; /* message data */
27 };
28+#else
29+#endif
30
31 static void msr(int msqid)
32 {
33--
342.7.4
35
diff --git a/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
index 945280c627..4ac14dc857 100644
--- a/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
+++ b/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
@@ -1,11 +1,12 @@
1From aff0e2a8f011fa80b472355355a7e8cdacd50189 Mon Sep 17 00:00:00 2001 1From dc1905b6d972f9176b40da270c83d8fb4d1751b5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 7 Jan 2016 19:53:30 +0000 3Date: Wed, 8 Feb 2017 16:12:34 +0800
4Subject: [PATCH 11/32] Rename sigset variable to sigset1 4Subject: [PATCH 2/5] Rename sigset variable to sigset1
5 5
6sigset API from signal.h is shadowed by this name conflict 6sigset API from signal.h is shadowed by this name conflict
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: Dengke Du <dengke.du@windriver.com>
9--- 10---
10 testcases/kernel/mem/shmt/shmt04.c | 10 +++++----- 11 testcases/kernel/mem/shmt/shmt04.c | 10 +++++-----
11 testcases/kernel/mem/shmt/shmt06.c | 10 +++++----- 12 testcases/kernel/mem/shmt/shmt06.c | 10 +++++-----
@@ -13,15 +14,15 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 3 files changed, 15 insertions(+), 15 deletions(-) 14 3 files changed, 15 insertions(+), 15 deletions(-)
14 15
15diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c 16diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
16index 7203e9e..fce87d6 100644 17index b2682da..3f35fad 100644
17--- a/testcases/kernel/mem/shmt/shmt04.c 18--- a/testcases/kernel/mem/shmt/shmt04.c
18+++ b/testcases/kernel/mem/shmt/shmt04.c 19+++ b/testcases/kernel/mem/shmt/shmt04.c
19@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */ 20@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
20 /**************/ 21 /**************/
21 22
22 key_t key; 23 key_t key;
23-sigset_t sigset; 24-sigset_t set;
24+sigset_t sigset1; 25+sigset_t set1;
25 26
26 #define SIZE 16*1024 27 #define SIZE 16*1024
27 28
@@ -29,12 +30,12 @@ index 7203e9e..fce87d6 100644
29 30
30 key = (key_t) getpid(); 31 key = (key_t) getpid();
31 32
32- sigemptyset(&sigset); 33- sigemptyset(&set);
33- sigaddset(&sigset, SIGUSR1); 34- sigaddset(&set, SIGUSR1);
34- sigprocmask(SIG_BLOCK, &sigset, NULL); 35- sigprocmask(SIG_BLOCK, &set, NULL);
35+ sigemptyset(&sigset1); 36+ sigemptyset(&set1);
36+ sigaddset(&sigset1, SIGUSR1); 37+ sigaddset(&set1, SIGUSR1);
37+ sigprocmask(SIG_BLOCK, &sigset1, NULL); 38+ sigprocmask(SIG_BLOCK, &set1, NULL);
38 39
39 pid = fork(); 40 pid = fork();
40 switch (pid) { 41 switch (pid) {
@@ -42,21 +43,21 @@ index 7203e9e..fce87d6 100644
42 char *cp; 43 char *cp;
43 int sig; 44 int sig;
44 45
45- sigwait(&sigset, &sig); 46- sigwait(&set, &sig);
46+ sigwait(&sigset1, &sig); 47+ sigwait(&set1, &sig);
47 chld_pid = getpid(); 48 chld_pid = getpid();
48 /*--------------------------------------------------------*/ 49 /*--------------------------------------------------------*/
49 50
50diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c 51diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
51index a3c9ca3..77b0fc9 100644 52index dd69de7..56fb1da 100644
52--- a/testcases/kernel/mem/shmt/shmt06.c 53--- a/testcases/kernel/mem/shmt/shmt06.c
53+++ b/testcases/kernel/mem/shmt/shmt06.c 54+++ b/testcases/kernel/mem/shmt/shmt06.c
54@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */ 55@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
55 /**************/ 56 /**************/
56 57
57 key_t key; 58 key_t key;
58-sigset_t sigset; 59-sigset_t set;
59+sigset_t sigset1; 60+sigset_t set1;
60 61
61 int child(); 62 int child();
62 static int rm_shm(int); 63 static int rm_shm(int);
@@ -64,12 +65,12 @@ index a3c9ca3..77b0fc9 100644
64 65
65 key = (key_t) getpid(); 66 key = (key_t) getpid();
66 67
67- sigemptyset(&sigset); 68- sigemptyset(&set);
68- sigaddset(&sigset, SIGUSR1); 69- sigaddset(&set, SIGUSR1);
69- sigprocmask(SIG_BLOCK, &sigset, NULL); 70- sigprocmask(SIG_BLOCK, &set, NULL);
70+ sigemptyset(&sigset1); 71+ sigemptyset(&set1);
71+ sigaddset(&sigset1, SIGUSR1); 72+ sigaddset(&set1, SIGUSR1);
72+ sigprocmask(SIG_BLOCK, &sigset1, NULL); 73+ sigprocmask(SIG_BLOCK, &set1, NULL);
73 74
74 pid = fork(); 75 pid = fork();
75 switch (pid) { 76 switch (pid) {
@@ -77,21 +78,21 @@ index a3c9ca3..77b0fc9 100644
77 char *cp; 78 char *cp;
78 int sig; 79 int sig;
79 80
80- sigwait(&sigset, &sig); 81- sigwait(&set, &sig);
81+ sigwait(&sigset1, &sig); 82+ sigwait(&set1, &sig);
82 chld_pid = getpid(); 83 chld_pid = getpid();
83 84
84 if ((shmid = shmget(key, SIZE, 0)) < 0) { 85 if ((shmid = shmget(key, SIZE, 0)) < 0) {
85diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c 86diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
86index 20fca52..6fb1d57 100644 87index 232d25a..06d902f 100644
87--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c 88--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
88+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c 89+++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
89@@ -91,7 +91,7 @@ int TST_TOTAL = 1; 90@@ -91,7 +91,7 @@ int TST_TOTAL = 1;
90 int sig_catch = 0; /* variable to blocked/unblocked signals */ 91 int sig_catch = 0; /* variable to blocked/unblocked signals */
91 92
92 struct sigaction sa_new; /* struct to hold signal info */ 93 struct sigaction sa_new; /* struct to hold signal info */
93-sigset_t sigset; /* signal set to hold signal lists */ 94-sigset_t set; /* signal set to hold signal lists */
94+sigset_t sigset1; /* signal set to hold signal lists */ 95+sigset_t set1; /* signal set to hold signal lists */
95 sigset_t sigset2; 96 sigset_t sigset2;
96 97
97 int main(int ac, char **av) 98 int main(int ac, char **av)
@@ -99,8 +100,8 @@ index 20fca52..6fb1d57 100644
99 * so that, signal will not be delivered to 100 * so that, signal will not be delivered to
100 * the test process. 101 * the test process.
101 */ 102 */
102- TEST(sigprocmask(SIG_BLOCK, &sigset, 0)); 103- TEST(sigprocmask(SIG_BLOCK, &set, 0));
103+ TEST(sigprocmask(SIG_BLOCK, &sigset1, 0)); 104+ TEST(sigprocmask(SIG_BLOCK, &set1, 0));
104 105
105 /* Get the process id of test process */ 106 /* Get the process id of test process */
106 my_pid = getpid(); 107 my_pid = getpid();
@@ -108,8 +109,8 @@ index 20fca52..6fb1d57 100644
108 */ 109 */
109 errno = 0; 110 errno = 0;
110 if (sigprocmask(SIG_UNBLOCK, 111 if (sigprocmask(SIG_UNBLOCK,
111- &sigset, 0) == -1) { 112- &set, 0) == -1) {
112+ &sigset1, 0) == -1) { 113+ &set1, 0) == -1) {
113 tst_brkm(TFAIL, cleanup, 114 tst_brkm(TFAIL, cleanup,
114 "sigprocmask() failed " 115 "sigprocmask() failed "
115 "to unblock signal, " 116 "to unblock signal, "
@@ -117,8 +118,8 @@ index 20fca52..6fb1d57 100644
117 * Initialise the signal sets with the list that 118 * Initialise the signal sets with the list that
118 * excludes/includes all system-defined signals. 119 * excludes/includes all system-defined signals.
119 */ 120 */
120- if (sigemptyset(&sigset) == -1) { 121- if (sigemptyset(&set) == -1) {
121+ if (sigemptyset(&sigset1) == -1) { 122+ if (sigemptyset(&set1) == -1) {
122 tst_brkm(TFAIL, cleanup, 123 tst_brkm(TFAIL, cleanup,
123 "sigemptyset() failed, errno=%d : %s", 124 "sigemptyset() failed, errno=%d : %s",
124 errno, strerror(errno)); 125 errno, strerror(errno));
@@ -126,11 +127,11 @@ index 20fca52..6fb1d57 100644
126 * Add specified signal (SIGINT) to the signal set 127 * Add specified signal (SIGINT) to the signal set
127 * which excludes system-defined signals. 128 * which excludes system-defined signals.
128 */ 129 */
129- if (sigaddset(&sigset, SIGINT) == -1) { 130- if (sigaddset(&set, SIGINT) == -1) {
130+ if (sigaddset(&sigset1, SIGINT) == -1) { 131+ if (sigaddset(&set1, SIGINT) == -1) {
131 tst_brkm(TFAIL, cleanup, 132 tst_brkm(TFAIL, cleanup,
132 "sigaddset() failed, errno=%d : %s", 133 "sigaddset() failed, errno=%d : %s",
133 errno, strerror(errno)); 134 errno, strerror(errno));
134-- 135--
1352.7.0 1362.7.4
136 137
diff --git a/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch b/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch
new file mode 100644
index 0000000000..2600bd60d0
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0012-fix-faccessat01.c-build-fails-with-security-flags.patch
@@ -0,0 +1,70 @@
1From 32f563008f95975d26d1c4fcb266c72c56f934be Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 22 Feb 2017 01:21:55 -0500
4Subject: [PATCH] fix faccessat01.c build fails with security flags
5
6When the distro is poky-lsb, fix the following error:
7
8| In file included from ../../../../include/old/test.h:47:0,
9| from faccessat01.c:44:
10| faccessat01.c: In function 'setup':
11| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
12| (path), (fmt), ## __VA_ARGS__)
13| ^
14| faccessat01.c:132:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
15| SAFE_FILE_PRINTF(cleanup, testfile, testfile);
16| ^~~~~~~~~~~~~~~~
17| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
18| (path), (fmt), ## __VA_ARGS__)
19| ^
20| faccessat01.c:133:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
21| SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
22| ^~~~~~~~~~~~~~~~
23
24This is because in macro "SAFE_FILE_PRINTF", its third argument should be a
25format arguments, but in file faccessat01.c, it passed the same argument to
26macro "SAFE_FILE_PRINTF", so it results in the fails. It should pass the format
27string to the third argument.
28
29The same for file fchmodat01.c.
30
31Signed-off-by: Dengke Du <dengke.du@windriver.com>
32Upstream-Status: Pending
33---
34 testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
35 testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++--
36 2 files changed, 4 insertions(+), 4 deletions(-)
37
38diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
39index 622dfd3..1ca90e9 100644
40--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
41+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
42@@ -129,8 +129,8 @@ void setup(void)
43 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
44 fds[1] = fds[4] = fds[0];
45
46- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
47- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
48+ SAFE_FILE_PRINTF(cleanup, testfile, "faccessattestfile%d.txt");
49+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s/faccessattestfile%d.txt");
50
51 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
52
53diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
54index 6bf66d8..89d072a 100644
55--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
56+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
57@@ -127,8 +127,8 @@ void setup(void)
58 fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
59 fds[1] = fds[4] = fds[0];
60
61- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
62- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
63+ SAFE_FILE_PRINTF(cleanup, testfile, "fchmodattest%d.txt");
64+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s/fchmodattest%d.txt");
65
66 fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
67 fds[3] = 100;
68--
692.8.1
70
diff --git a/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
deleted file mode 100644
index e1532c1fc9..0000000000
--- a/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
+++ /dev/null
@@ -1,351 +0,0 @@
1From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:58:08 +0000
4Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t
5
6int64_t is defined in ISO C99
7include limits.h to get defintions of PATH_MAX
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/fs/fsstress/fsstress.c | 31 +++++++++---------
12 testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++-------------
13 2 files changed, 40 insertions(+), 38 deletions(-)
14
15diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
16index 2f89903..89f0b19 100644
17--- a/testcases/kernel/fs/fsstress/fsstress.c
18+++ b/testcases/kernel/fs/fsstress/fsstress.c
19@@ -36,6 +36,7 @@
20 #ifdef HAVE_SYS_PRCTL_H
21 # include <sys/prctl.h>
22 #endif
23+#include <limits.h>
24
25 #define XFS_ERRTAG_MAX 17
26
27@@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r)
28 __u64 last;
29 __s32 nent;
30 xfs_bstat_t *t;
31- __int64_t total;
32+ int64_t total;
33 xfs_fsop_bulkreq_t bsr;
34
35 last = 0;
36@@ -1764,14 +1765,14 @@ int setdirect(int fd)
37
38 void dread_f(int opno, long r)
39 {
40- __int64_t align;
41+ int64_t align;
42 char *buf = NULL;
43 struct dioattr diob;
44 int e;
45 pathname_t f;
46 int fd;
47 size_t len;
48- __int64_t lr;
49+ int64_t lr;
50 off64_t off;
51 struct stat64 stb;
52 int v;
53@@ -1835,8 +1836,8 @@ void dread_f(int opno, long r)
54 return;
55 }
56 #endif
57- align = (__int64_t) diob.d_miniosz;
58- lr = ((__int64_t) random() << 32) + random();
59+ align = (int64_t) diob.d_miniosz;
60+ lr = ((int64_t) random() << 32) + random();
61 off = (off64_t) (lr % stb.st_size);
62 off -= (off % align);
63 lseek64(fd, off, SEEK_SET);
64@@ -1865,14 +1866,14 @@ void dread_f(int opno, long r)
65
66 void dwrite_f(int opno, long r)
67 {
68- __int64_t align;
69+ int64_t align;
70 char *buf = NULL;
71 struct dioattr diob;
72 int e;
73 pathname_t f;
74 int fd;
75 size_t len;
76- __int64_t lr;
77+ int64_t lr;
78 off64_t off;
79 struct stat64 stb;
80 int v;
81@@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r)
82 return;
83 }
84 #endif
85- align = (__int64_t) diob.d_miniosz;
86- lr = ((__int64_t) random() << 32) + random();
87+ align = (int64_t) diob.d_miniosz;
88+ lr = ((int64_t) random() << 32) + random();
89 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
90 off -= (off % align);
91 lseek64(fd, off, SEEK_SET);
92@@ -2224,7 +2225,7 @@ void read_f(int opno, long r)
93 pathname_t f;
94 int fd;
95 size_t len;
96- __int64_t lr;
97+ int64_t lr;
98 off64_t off;
99 struct stat64 stb;
100 int v;
101@@ -2262,7 +2263,7 @@ void read_f(int opno, long r)
102 close(fd);
103 return;
104 }
105- lr = ((__int64_t) random() << 32) + random();
106+ lr = ((int64_t) random() << 32) + random();
107 off = (off64_t) (lr % stb.st_size);
108 lseek64(fd, off, SEEK_SET);
109 len = (random() % (getpagesize() * 32)) + 1;
110@@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r)
111 {
112 int e;
113 pathname_t f;
114- __int64_t lr;
115+ int64_t lr;
116 off64_t off;
117 struct stat64 stb;
118 int v;
119@@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r)
120 free_pathname(&f);
121 return;
122 }
123- lr = ((__int64_t) random() << 32) + random();
124+ lr = ((int64_t) random() << 32) + random();
125 off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
126 off %= maxfsize;
127 e = truncate64_path(&f, off) < 0 ? errno : 0;
128@@ -2626,7 +2627,7 @@ void write_f(int opno, long r)
129 pathname_t f;
130 int fd;
131 size_t len;
132- __int64_t lr;
133+ int64_t lr;
134 off64_t off;
135 struct stat64 stb;
136 int v;
137@@ -2656,7 +2657,7 @@ void write_f(int opno, long r)
138 close(fd);
139 return;
140 }
141- lr = ((__int64_t) random() << 32) + random();
142+ lr = ((int64_t) random() << 32) + random();
143 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
144 off %= maxfsize;
145 lseek64(fd, off, SEEK_SET);
146diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c
147index ac91262..a34c416 100644
148--- a/testcases/network/nfs/nfs_fsstress/fsstress.c
149+++ b/testcases/network/nfs/nfs_fsstress/fsstress.c
150@@ -31,6 +31,7 @@
151 */
152
153 #include "global.h"
154+#include <limits.h>
155
156 #define XFS_ERRTAG_MAX 17
157
158@@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r)
159 pathname_t f;
160 int fd;
161 struct flock64 fl;
162- __int64_t lr;
163+ int64_t lr;
164 off64_t off;
165 struct stat64 stb;
166 int v;
167@@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r)
168 close(fd);
169 return;
170 }
171- lr = ((__int64_t) random() << 32) + random();
172+ lr = ((int64_t) random() << 32) + random();
173 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
174 off %= maxfsize;
175 fl.l_whence = SEEK_SET;
176@@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r)
177 __uint64_t last;
178 int nent;
179 xfs_bstat_t *t;
180- __int64_t total;
181+ int64_t total;
182 xfs_fsop_bulkreq_t bsr;
183
184 last = 0;
185@@ -1708,14 +1709,14 @@ int setdirect(int fd)
186
187 void dread_f(int opno, long r)
188 {
189- __int64_t align;
190+ int64_t align;
191 char *buf;
192 struct dioattr diob;
193 int e;
194 pathname_t f;
195 int fd;
196 size_t len;
197- __int64_t lr;
198+ int64_t lr;
199 off64_t off;
200 struct stat64 stb;
201 int v;
202@@ -1775,8 +1776,8 @@ void dread_f(int opno, long r)
203 return;
204 }
205 #endif
206- align = (__int64_t) diob.d_miniosz;
207- lr = ((__int64_t) random() << 32) + random();
208+ align = (int64_t) diob.d_miniosz;
209+ lr = ((int64_t) random() << 32) + random();
210 off = (off64_t) (lr % stb.st_size);
211 off -= (off % align);
212 lseek64(fd, off, SEEK_SET);
213@@ -1798,14 +1799,14 @@ void dread_f(int opno, long r)
214
215 void dwrite_f(int opno, long r)
216 {
217- __int64_t align;
218+ int64_t align;
219 char *buf;
220 struct dioattr diob;
221 int e;
222 pathname_t f;
223 int fd;
224 size_t len;
225- __int64_t lr;
226+ int64_t lr;
227 off64_t off;
228 struct stat64 stb;
229 int v;
230@@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r)
231 return;
232 }
233 #endif
234- align = (__int64_t) diob.d_miniosz;
235- lr = ((__int64_t) random() << 32) + random();
236+ align = (int64_t) diob.d_miniosz;
237+ lr = ((int64_t) random() << 32) + random();
238 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
239 off -= (off % align);
240 lseek64(fd, off, SEEK_SET);
241@@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r)
242 pathname_t f;
243 int fd;
244 struct flock64 fl;
245- __int64_t lr;
246+ int64_t lr;
247 off64_t off;
248 struct stat64 stb;
249 int v;
250@@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r)
251 close(fd);
252 return;
253 }
254- lr = ((__int64_t) random() << 32) + random();
255+ lr = ((int64_t) random() << 32) + random();
256 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
257 off %= maxfsize;
258 fl.l_whence = SEEK_SET;
259@@ -2145,7 +2146,7 @@ void read_f(int opno, long r)
260 pathname_t f;
261 int fd;
262 size_t len;
263- __int64_t lr;
264+ int64_t lr;
265 off64_t off;
266 struct stat64 stb;
267 int v;
268@@ -2183,7 +2184,7 @@ void read_f(int opno, long r)
269 close(fd);
270 return;
271 }
272- lr = ((__int64_t) random() << 32) + random();
273+ lr = ((int64_t) random() << 32) + random();
274 off = (off64_t) (lr % stb.st_size);
275 lseek64(fd, off, SEEK_SET);
276 len = (random() % (getpagesize() * 32)) + 1;
277@@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r)
278 pathname_t f;
279 int fd;
280 struct flock64 fl;
281- __int64_t lr;
282+ int64_t lr;
283 off64_t off;
284 struct stat64 stb;
285 int v;
286@@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r)
287 close(fd);
288 return;
289 }
290- lr = ((__int64_t) random() << 32) + random();
291+ lr = ((int64_t) random() << 32) + random();
292 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
293 off %= maxfsize;
294 fl.l_whence = SEEK_SET;
295@@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r)
296 {
297 int e;
298 pathname_t f;
299- __int64_t lr;
300+ int64_t lr;
301 off64_t off;
302 struct stat64 stb;
303 int v;
304@@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r)
305 free_pathname(&f);
306 return;
307 }
308- lr = ((__int64_t) random() << 32) + random();
309+ lr = ((int64_t) random() << 32) + random();
310 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
311 off %= maxfsize;
312 e = truncate64_path(&f, off) < 0 ? errno : 0;
313@@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r)
314 pathname_t f;
315 int fd;
316 struct flock64 fl;
317- __int64_t lr;
318+ int64_t lr;
319 off64_t off;
320 struct stat64 stb;
321 int v;
322@@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r)
323 close(fd);
324 return;
325 }
326- lr = ((__int64_t) random() << 32) + random();
327+ lr = ((int64_t) random() << 32) + random();
328 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
329 off %= maxfsize;
330 fl.l_whence = SEEK_SET;
331@@ -2543,7 +2544,7 @@ void write_f(int opno, long r)
332 pathname_t f;
333 int fd;
334 size_t len;
335- __int64_t lr;
336+ int64_t lr;
337 off64_t off;
338 struct stat64 stb;
339 int v;
340@@ -2573,7 +2574,7 @@ void write_f(int opno, long r)
341 close(fd);
342 return;
343 }
344- lr = ((__int64_t) random() << 32) + random();
345+ lr = ((int64_t) random() << 32) + random();
346 off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
347 off %= maxfsize;
348 lseek64(fd, off, SEEK_SET);
349--
3502.7.0
351
diff --git a/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch b/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
deleted file mode 100644
index 4266e4fc3a..0000000000
--- a/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From 1ef8c32317064438ec3b37a114f5d82957f4e0c6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:05:54 +0000
4Subject: [PATCH 13/32] include fcntl.h for getting O_* definitions
5
6musl exposes this issue, with glibc fcntl.h is included via some other
7header and this problem remained latent
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/ipc/ipc_stress/shmem_test_03.c | 1 +
12 testcases/kernel/syscalls/mq_notify/mq_notify01.c | 1 +
13 testcases/network/tcp_cmds/sendfile/testsf_c.c | 1 +
14 testcases/network/tcp_cmds/sendfile/testsf_s.c | 1 +
15 4 files changed, 4 insertions(+)
16
17diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
18index c1b11fd..8be156f 100644
19--- a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
20+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
21@@ -72,6 +72,7 @@
22 #include <string.h>
23 #include <unistd.h>
24 #include <limits.h>
25+#include <fcntl.h>
26 #include <sys/file.h>
27 #include <sys/ipc.h>
28 #include <sys/mman.h>
29diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
30index 4728c70..5c7846c 100644
31--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
32+++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
33@@ -41,6 +41,7 @@
34 #include <mqueue.h>
35 #include <signal.h>
36 #include <stdlib.h>
37+#include <fcntl.h>
38
39 #include "../utils/include_j_h.h"
40
41diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c
42index 449784f..38d3274 100644
43--- a/testcases/network/tcp_cmds/sendfile/testsf_c.c
44+++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c
45@@ -9,6 +9,7 @@
46 #include <sys/types.h>
47 #include <stdlib.h>
48 #include <string.h>
49+#include <fcntl.h>
50 #include <sys/file.h>
51 #include <arpa/inet.h>
52 #include <netinet/in.h>
53diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c
54index 17e98ad..bce8dd1 100644
55--- a/testcases/network/tcp_cmds/sendfile/testsf_s.c
56+++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c
57@@ -6,6 +6,7 @@
58 #include <stdio.h>
59 #include <stdlib.h>
60 #include <unistd.h>
61+#include <fcntl.h>
62 #include <sys/file.h>
63 #include <errno.h>
64 #include <sys/signal.h>
65--
662.7.0
67
diff --git a/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch b/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
deleted file mode 100644
index 84d81e9f94..0000000000
--- a/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1From d63fefa86dac437c47b9ebbea0a82a1240aaba2c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:09:56 +0000
4Subject: [PATCH 14/32] hyperthreading: Include sys/types.h for pid_t
5 definition
6
7If sys/types.h is not included then it will not define pid_t_needed
8and therefore typedef wont be included and we get errors about pid_t
9being not known
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h | 1 +
14 testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h | 1 +
15 testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h | 1 +
16 3 files changed, 3 insertions(+)
17
18diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
19index 1ec9794..9084aa7 100644
20--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
21+++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
22@@ -3,6 +3,7 @@
23 #define _HTUTILS_H_
24
25 #include <stdlib.h>
26+#include <sys/types.h>
27
28 int is_cmdline_para(const char *para);
29
30diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
31index 1ec9794..c03a124 100644
32--- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
33+++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
34@@ -2,6 +2,7 @@
35 #ifndef _HTUTILS_H_
36 #define _HTUTILS_H_
37
38+#include <sys/types.h>
39 #include <stdlib.h>
40
41 int is_cmdline_para(const char *para);
42diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
43index 2977ad0..6b484e1 100644
44--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
45+++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
46@@ -3,6 +3,7 @@
47 #define _HTUTILS_H_
48
49 #include <stdlib.h>
50+#include <sys/types.h>
51
52 int is_cmdline_para(const char *para);
53
54--
552.7.0
56
diff --git a/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch b/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
deleted file mode 100644
index 963536f993..0000000000
--- a/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From f091839532f3afe0a58e8ba0b45615c899a43a47 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:12:09 +0000
4Subject: [PATCH 15/32] mincore01: Rename PAGESIZE to pagesize
5
6PAGESIZE conflicts with system headers on musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/syscalls/mincore/mincore01.c | 10 +++++-----
11 1 file changed, 5 insertions(+), 5 deletions(-)
12
13diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c
14index 97a3d95..fa426d1 100644
15--- a/testcases/kernel/syscalls/mincore/mincore01.c
16+++ b/testcases/kernel/syscalls/mincore/mincore01.c
17@@ -45,7 +45,7 @@
18 #include "test.h"
19 #include "safe_macros.h"
20
21-static int PAGESIZE;
22+static int pagesize;
23 static rlim_t STACK_LIMIT = 10485760;
24
25 static void cleanup(void);
26@@ -146,7 +146,7 @@ static void setup4(struct test_case_t *tc)
27 }
28
29 tc->addr = global_pointer;
30- tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + PAGESIZE;
31+ tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize;
32 tc->vector = global_vec;
33
34 /*
35@@ -161,7 +161,7 @@ static void setup(void)
36 char *buf;
37 int fd;
38
39- PAGESIZE = getpagesize();
40+ pagesize = getpagesize();
41
42 tst_sig(NOFORK, DEF_HANDLER, cleanup);
43
44@@ -170,7 +170,7 @@ static void setup(void)
45 TEST_PAUSE;
46
47 /* global_pointer will point to a mmapped area of global_len bytes */
48- global_len = PAGESIZE * 2;
49+ global_len = pagesize * 2;
50
51 buf = SAFE_MALLOC(cleanup, global_len);
52 memset(buf, 42, global_len);
53@@ -186,7 +186,7 @@ static void setup(void)
54 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
55
56 global_vec = SAFE_MALLOC(cleanup,
57- (global_len + PAGESIZE - 1) / PAGESIZE);
58+ (global_len + pagesize - 1) / pagesize);
59
60 SAFE_CLOSE(cleanup, fd);
61 }
62--
632.7.0
64
diff --git a/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch b/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
deleted file mode 100644
index 1b5b93a4e6..0000000000
--- a/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From 2b9be924bbad8a1f84ae553fdd1aa8391aa8d2f4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:15:07 +0000
4Subject: [PATCH 16/32] ustat: Change header from ustat.h to sys/ustat.h
5
6makes it portable for musl, on glibc ustat.h is just including
7sys/ustat.h too
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/syscalls/ustat/ustat01.c | 2 +-
12 testcases/kernel/syscalls/ustat/ustat02.c | 2 +-
13 2 files changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
16index 01b7688..494647b 100644
17--- a/testcases/kernel/syscalls/ustat/ustat01.c
18+++ b/testcases/kernel/syscalls/ustat/ustat01.c
19@@ -20,8 +20,8 @@
20 */
21
22 #include <unistd.h>
23-#include <ustat.h>
24 #include <errno.h>
25+#include <sys/ustat.h>
26 #include <sys/types.h>
27 #include <sys/stat.h>
28 #include "test.h"
29diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
30index 4e66236..edada31 100644
31--- a/testcases/kernel/syscalls/ustat/ustat02.c
32+++ b/testcases/kernel/syscalls/ustat/ustat02.c
33@@ -21,8 +21,8 @@
34 */
35
36 #include <unistd.h>
37-#include <ustat.h>
38 #include <errno.h>
39+#include <sys/ustat.h>
40 #include <sys/stat.h>
41 #include <sys/types.h>
42 #include "test.h"
43--
442.7.0
45
diff --git a/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch b/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
deleted file mode 100644
index ed25802a0c..0000000000
--- a/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
+++ /dev/null
@@ -1,88 +0,0 @@
1From c882bcd18820b44a685f0d5edd7aaff77a88c912 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 20:17:55 +0000
4Subject: [PATCH 17/32] replace sigval_t with union sigval
5
6This makes it compatible across musl and glibc
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2 +-
11 testcases/kernel/syscalls/timer_gettime/timer_gettime01.c | 2 +-
12 testcases/kernel/timers/timer_create/timer_create02.c | 4 ++--
13 testcases/kernel/timers/timer_create/timer_create03.c | 4 ++--
14 4 files changed, 6 insertions(+), 6 deletions(-)
15
16diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
17index d186c1f..bc03544 100644
18--- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
19+++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
20@@ -54,7 +54,7 @@ int main(int ac, char **av)
21
22 setup();
23
24- ev.sigev_value = (sigval_t) 0;
25+ ev.sigev_value = (union sigval) 0;
26 ev.sigev_signo = SIGALRM;
27 ev.sigev_notify = SIGEV_SIGNAL;
28 TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
29diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
30index b583aee..9371a6a 100644
31--- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
32+++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
33@@ -55,7 +55,7 @@ int main(int ac, char **av)
34
35 setup();
36
37- ev.sigev_value = (sigval_t) 0;
38+ ev.sigev_value = (union sigval) 0;
39 ev.sigev_signo = SIGALRM;
40 ev.sigev_notify = SIGEV_SIGNAL;
41 TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
42diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c
43index 7f528ed..1127400 100644
44--- a/testcases/kernel/timers/timer_create/timer_create02.c
45+++ b/testcases/kernel/timers/timer_create/timer_create02.c
46@@ -142,7 +142,7 @@ void setup_test(int option)
47 {
48 switch (option) {
49 case 0:
50- evp.sigev_value = (sigval_t) 0;
51+ evp.sigev_value = (union sigval) 0;
52 evp.sigev_signo = SIGALRM;
53 evp.sigev_notify = SIGEV_SIGNAL;
54 evp_ptr = &evp;
55@@ -151,7 +151,7 @@ void setup_test(int option)
56 evp_ptr = NULL;
57 break;
58 case 2:
59- evp.sigev_value = (sigval_t) 0;
60+ evp.sigev_value = (union sigval) 0;
61 evp.sigev_signo = SIGALRM; /* any will do */
62 evp.sigev_notify = SIGEV_NONE;
63 evp_ptr = &evp;
64diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c
65index 291fcfa..8b01bf7 100644
66--- a/testcases/kernel/timers/timer_create/timer_create03.c
67+++ b/testcases/kernel/timers/timer_create/timer_create03.c
68@@ -129,7 +129,7 @@ void setup_test(int option)
69 {
70 switch (option) {
71 case 0:
72- evp.sigev_value = (sigval_t) 0;
73+ evp.sigev_value = (union sigval) 0;
74 evp.sigev_signo = SIGALRM;
75 evp.sigev_notify = SIGEV_SIGNAL;
76 evp_ptr = &evp;
77@@ -138,7 +138,7 @@ void setup_test(int option)
78 evp_ptr = NULL;
79 break;
80 case 2:
81- evp.sigev_value = (sigval_t) 0;
82+ evp.sigev_value = (union sigval) 0;
83 evp.sigev_signo = SIGALRM; /* any will do */
84 evp.sigev_notify = SIGEV_NONE;
85 evp_ptr = &evp;
86--
872.7.0
88
diff --git a/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch b/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
deleted file mode 100644
index 0a4c5f0b3c..0000000000
--- a/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 721e94985b9cff3e2724af7ea5be7d005bc12dec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 06:55:27 +0000
4Subject: [PATCH 19/32] tomoyo: Replace canonicalize_file_name() with
5 realpath()
6
7canonicalize_file_name() API is specific to glibc
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
15index da4af0f..5c1a3ca 100644
16--- a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
17+++ b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
18@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
19 /* Test mount(). */
20 {
21 static char buf[4096];
22- char *dev_ram_path = canonicalize_file_name("/dev/ram0");
23+ char *dev_ram_path = realpath("/dev/ram0", NULL);
24 if (!dev_ram_path)
25- dev_ram_path = canonicalize_file_name("/dev/ram");
26+ dev_ram_path = realpath("/dev/ram", NULL);
27 if (!dev_ram_path) {
28 dev_ram_path = "/dev/ram0";
29 mknod(dev_ram_path, S_IFBLK, MKDEV(1, 0));
30--
312.7.0
32
diff --git a/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch b/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
deleted file mode 100644
index 413b44ac71..0000000000
--- a/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 7ac6fd51991ac61d1d7594f601d87842060ee284 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:06:11 +0000
4Subject: [PATCH 22/32] include sys/types.h
5
6Fixes
7
8error: unknown type name 'uint'
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 testcases/kernel/ipc/ipc_stress/shmem_test_04.c | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
16index 72c2e60..e7e5f61 100644
17--- a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
18+++ b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
19@@ -65,6 +65,7 @@
20 #include <signal.h>
21 #include <stdint.h>
22 #include <sys/mman.h>
23+#include <sys/types.h>
24
25 #ifdef _LINUX_
26 typedef unsigned long ulong_t;
27--
282.7.0
29
diff --git a/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
index b47d0977eb..f75e33bd16 100644
--- a/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
+++ b/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
@@ -1,29 +1,30 @@
1From 4a74b275acc8158850f2500928a1467c3482c986 Mon Sep 17 00:00:00 2001 1From 1471012164ba8f26046d4b1ce5531a0d92805ef5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Dengke Du <dengke.du@windriver.com>
3Date: Fri, 8 Jan 2016 07:23:11 +0000 3Date: Wed, 8 Feb 2017 16:21:16 +0800
4Subject: [PATCH 27/32] sysconf01: Use _SC_2_C_VERSION conditionally 4Subject: [PATCH 4/5] sysconf01: Use _SC_2_C_VERSION conditionally
5 5
6_SC_2_C_VERSION is not available on musl 6_SC_2_C_VERSION is not available on musl
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: Dengke Du <dengke.du@windriver.com>
9--- 10---
10 testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++ 11 testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
11 1 file changed, 2 insertions(+) 12 1 file changed, 2 insertions(+)
12 13
13diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c 14diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
14index 8542e77..e806943 100644 15index 583deef..de93695 100644
15--- a/testcases/kernel/syscalls/sysconf/sysconf01.c 16--- a/testcases/kernel/syscalls/sysconf/sysconf01.c
16+++ b/testcases/kernel/syscalls/sysconf/sysconf01.c 17+++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
17@@ -102,7 +102,9 @@ int main(void) 18@@ -103,7 +103,9 @@ int main(void)
18 test_sysconf(_SC_ATEXIT_MAX);
19 test_sysconf(_SC_2_C_BIND); 19 test_sysconf(_SC_2_C_BIND);
20 test_sysconf(_SC_2_C_DEV); 20 test_sysconf(_SC_2_C_DEV);
21 #ifdef _SC_2_C_VERSION
21+#ifdef __GLIBC__ 22+#ifdef __GLIBC__
22 test_sysconf(_SC_2_C_VERSION); 23 test_sysconf(_SC_2_C_VERSION);
23+#endif 24+#endif
24 /* 21 - 25 */ 25 #else
25 test_sysconf(_SC_2_CHAR_TERM); 26 tst_resm(TCONF, "_SC_2_C_VERSION not defined");
26 test_sysconf(_SC_2_FORT_DEV); 27 #endif
27-- 28--
282.7.0 292.7.4
29 30
diff --git a/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch b/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
deleted file mode 100644
index f7ece9e18e..0000000000
--- a/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 2f8a57f66a94210d34dd0361659a8297cf3d813f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:29:24 +0000
4Subject: [PATCH 29/32] trace_shed: Fix build with musl
5
6Errors on musl are
7
8trace_sched.c:425:16: error: invalid operands to binary & (have
9'thread_sched_t * {aka struct <anonymous> *}' and 'int')
10 thrd_ndx, WEXITSTATUS(status));
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 testcases/kernel/sched/tool/trace_sched.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/testcases/kernel/sched/tool/trace_sched.c b/testcases/kernel/sched/tool/trace_sched.c
18index 7815686..30dca5f 100644
19--- a/testcases/kernel/sched/tool/trace_sched.c
20+++ b/testcases/kernel/sched/tool/trace_sched.c
21@@ -422,7 +422,7 @@ int main(int argc, /* number of input parameters. */
22 if (status == (thread_sched_t *) - 1) {
23 fprintf(stderr,
24 "thread [%d] - process exited with errors %d\n",
25- thrd_ndx, WEXITSTATUS(status));
26+ thrd_ndx, WEXITSTATUS((int)status));
27 exit(-1);
28 } else {
29 exp_prio[thrd_ndx] = status->exp_prio;
30--
312.7.0
32
diff --git a/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
index d2d6d76fd7..c5fac9b040 100644
--- a/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
+++ b/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
@@ -1,33 +1,33 @@
1From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001 1From 00ba7cdd0608b1507027428f9f87b1cb9747372b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Dengke Du <dengke.du@windriver.com>
3Date: Fri, 8 Jan 2016 07:32:24 +0000 3Date: Thu, 9 Feb 2017 15:54:53 +0800
4Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of 4Subject: [PATCH] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
5 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc 5 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
6 6
7e.g. musl does not implement the _NP mutex types 7e.g. musl does not implement the _NP mutex types
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Signed-off-by: Dengke Du <dengke.du@windriver.com>
10--- 11---
11 lib/tst_res.c | 5 ++++- 12 lib/tst_res.c | 4 ++++
12 1 file changed, 4 insertions(+), 1 deletion(-) 13 1 file changed, 4 insertions(+)
13 14
14diff --git a/lib/tst_res.c b/lib/tst_res.c 15diff --git a/lib/tst_res.c b/lib/tst_res.c
15index 5c1c58c..3244b5e 100644 16index 61daaeb..435224f 100644
16--- a/lib/tst_res.c 17--- a/lib/tst_res.c
17+++ b/lib/tst_res.c 18+++ b/lib/tst_res.c
18@@ -104,8 +104,11 @@ int TEST_ERRNO; 19@@ -79,7 +79,11 @@ int TEST_ERRNO;
19 assert(strlen(buf) > 0); \ 20 assert(strlen(buf) > 0); \
20 } while (0) 21 } while (0)
21 22
22+#ifdef __GLIBC__ 23+#ifdef __GLIBC__
23 static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; 24 static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
24-
25+#else 25+#else
26+static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE }; 26+static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE };
27+#endif 27+#endif
28 /* 28
29 * Define local function prototypes. 29 static void check_env(void);
30 */ 30 static void tst_condense(int tnum, int ttype, const char *tmesg);
31-- 31--
322.7.0 322.7.4
33 33
diff --git a/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch b/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
deleted file mode 100644
index 473ca4c65e..0000000000
--- a/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 293ff1da06748ed4c69be6ece262d42e562e7298 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:36:19 +0000
4Subject: [PATCH 31/32] vma03: fix page size offset as per page size alignment
5
6the offset the param of mmap2() doesn't align the page size, but,
7this param allow must be a multiple of the page size as returned
8by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
9multiple of the system page size, so modify the input param of offset
10pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
11
12Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 testcases/kernel/mem/vma/vma03.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
19index ad8a7b4..a539233 100644
20--- a/testcases/kernel/mem/vma/vma03.c
21+++ b/testcases/kernel/mem/vma/vma03.c
22@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
23 if (fd == -1)
24 tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
25
26- pgoff = ULONG_MAX - 1;
27+ pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
28 map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
29 fd, pgoff);
30 if (map == MAP_FAILED)
31--
322.7.0
33
diff --git a/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch b/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
deleted file mode 100644
index 5c6bf919f8..0000000000
--- a/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 4f1905ff09c730091674818bd1b48ee221347101 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 08:30:29 +0000
4Subject: [PATCH 32/32] regen.sh: Include asm/unistd.h explicitly
5
6on musl this is not included indirectly and it results in errors like
7testcases/kernel/include/linux_syscall_numbers.h:1035:25: error:
8'__NR_SYSCALL_BASE' undeclared (first use in this function)
9| # define __NR_readdir (__NR_SYSCALL_BASE+ 89)
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 testcases/kernel/include/regen.sh | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
17index f93f49b..ee790af 100755
18--- a/testcases/kernel/include/regen.sh
19+++ b/testcases/kernel/include/regen.sh
20@@ -32,6 +32,7 @@ cat << EOF > "${output_pid}"
21
22 #include <errno.h>
23 #include <sys/syscall.h>
24+#include <asm/unistd.h>
25 #include "cleanup.c"
26
27 #define ltp_syscall(NR, ...) ({ \\
28--
292.7.0
30
diff --git a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
index 32ae8aa271..71e32a5e51 100644
--- a/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
+++ b/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
@@ -1,23 +1,32 @@
1Fix test_proc_kill hanging 1From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 8 Feb 2017 16:17:17 +0800
4Subject: [PATCH 3/5] Fix test_proc_kill hanging
2 5
3Sometimes the signal is delivered to memcg_process before the framework took 6Sometimes the signal is delivered to memcg_process before the framework took
4into consideration its pid entered in the tasks. Fixed by delaying the signal 7into consideration its pid entered in the tasks. Fixed by delaying the signal
5send command. 8send command.
6 9
7Signed-off-by: George Nita <george.nita@enea.com> 10Signed-off-by: George Nita <george.nita@enea.com>
8Upstream-Status: Pending 11Signed-off-by: Dengke Du <dengke.du@windriver.com>
12
13Upstream-Status: Pending
14---
15 testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 +
16 1 file changed, 1 insertion(+)
9 17
10diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 18diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
11index ffbe006..e81bf74 100755 19index b785fe3..2918cc5 100755
12--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 20--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
13+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh 21+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
14@@ -220,8 +220,8 @@ test_proc_kill() 22@@ -283,6 +283,7 @@ test_proc_kill()
15
16 $TEST_PATH/memcg_process $2 -s $3 &
17 pid=$! 23 pid=$!
18- sleep 1 24 TST_CHECKPOINT_WAIT 0
19 echo $pid > tasks 25 echo $pid > tasks
20+ sleep 1 26+ sleep 1
21 27
22 kill -s USR1 $pid 2> /dev/null 28 signal_memcg_process $pid $3
23 sleep 1 29
30--
312.7.4
32
diff --git a/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch b/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch
deleted file mode 100644
index 18d1f727f2..0000000000
--- a/meta/recipes-extended/ltp/ltp/0037-containers-netns_netlink-Avoid-segmentation-fault.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From 193ce739b2a5174269a958b00c3a5590de944e0d Mon Sep 17 00:00:00 2001
2From: Huacai Chen <chenhc@lemote.com>
3Date: Thu, 27 Oct 2016 14:45:52 +0800
4Subject: [PATCH] containers/netns_netlink: Avoid segmentation fault
5
6In order to avoid segmentation fault (use NULL as a function pointer),
7this patch modify check_netns() by passing a dummy function pointer to
8do_clone_unshare_test().
9
10Signed-off-by: Huacai Chen <chenhc@lemote.com>
11Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
12
13Upstream-Status: Backport
14
15Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
16---
17 testcases/kernel/containers/netns/netns_helper.h | 10 ++++++++--
18 1 file changed, 8 insertions(+), 2 deletions(-)
19
20diff --git a/testcases/kernel/containers/netns/netns_helper.h b/testcases/kernel/containers/netns/netns_helper.h
21index 2a331ae..7df6dcb 100644
22--- a/testcases/kernel/containers/netns/netns_helper.h
23+++ b/testcases/kernel/containers/netns/netns_helper.h
24@@ -56,6 +56,12 @@ static void check_iproute(unsigned int spe_ipver)
25 pclose(ipf);
26 }
27
28+static int dummy(void *arg)
29+{
30+ (void) arg;
31+ return 0;
32+}
33+
34 static void check_netns(void)
35 {
36 int pid, status;
37@@ -64,8 +70,8 @@ static void check_netns(void)
38 tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWNS (%d) not supported",
39 CLONE_NEWNS);
40
41- pid = do_clone_unshare_test(T_UNSHARE, CLONE_NEWNET | CLONE_NEWNS, NULL,
42- NULL);
43+ pid = do_clone_unshare_test(T_UNSHARE, CLONE_NEWNET | CLONE_NEWNS,
44+ dummy, NULL);
45 if (pid == -1)
46 tst_brkm(TCONF | TERRNO, NULL,
47 "unshare syscall smoke test failed");
48--
492.7.4
50
diff --git a/meta/recipes-extended/ltp/ltp/0038-run-posix-option-group-test-replace-CWD-qith-PWD.patch b/meta/recipes-extended/ltp/ltp/0038-run-posix-option-group-test-replace-CWD-qith-PWD.patch
deleted file mode 100644
index 8034152fd7..0000000000
--- a/meta/recipes-extended/ltp/ltp/0038-run-posix-option-group-test-replace-CWD-qith-PWD.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From f356775c400f40e3803d80a7bd295b4265959c45 Mon Sep 17 00:00:00 2001
2From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
3Date: Mon, 29 Feb 2016 14:34:40 +0530
4Subject: [PATCH] run-posix-option-group-test: replace CWD qith PWD
5
6When running LTP Open Posix Testsuite there is lot of messages as:
7
8| Usage: basename FILE [SUFFIX]
9|
10| Strip directory path and .SUFFIX from FILE
11|
12| *******************
13| Testing
14| *******************
15
16This is because there is no $CWD defined in shell and it looks like $PWD
17was intended instead.
18
19Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
20Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
21
22Upstream-Status: Backport
23
24Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
25---
26 testcases/open_posix_testsuite/bin/run-tests.sh | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/testcases/open_posix_testsuite/bin/run-tests.sh b/testcases/open_posix_testsuite/bin/run-tests.sh
30index d4bd988..5ee5687 100755
31--- a/testcases/open_posix_testsuite/bin/run-tests.sh
32+++ b/testcases/open_posix_testsuite/bin/run-tests.sh
33@@ -29,7 +29,7 @@ run_test_loop() {
34
35 cat <<EOF
36 *******************
37-Testing $(basename $CWD)
38+Testing $(basename $PWD)
39 *******************
40 $(printf "PASS\t\t%3d" $NUM_PASS)
41 $(printf "FAIL\t\t%3d" $NUM_FAIL)
42--
432.7.4
44
diff --git a/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch b/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch
index f7e805a954..c0c1dadd05 100644
--- a/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch
+++ b/meta/recipes-extended/ltp/ltp/0039-fcntl-fix-the-time-def-to-use-time_t.patch
@@ -1,28 +1,29 @@
1From 9590d073d3abe02fe0783ef8c530aef2e873ba9b Mon Sep 17 00:00:00 2001 1From 7bce3d223494803cb32897cabe66119076e53d89 Mon Sep 17 00:00:00 2001
2From: Christopher Larson <chris_larson@mentor.com> 2From: Dengke Du <dengke.du@windriver.com>
3Date: Tue, 13 Dec 2016 12:48:29 -0700 3Date: Wed, 8 Feb 2017 16:23:51 +0800
4Subject: [PATCH] fcntl: fix the time() def to use time_t 4Subject: [PATCH 5/5] fcntl: fix the time() def to use time_t
5 5
6This fixes the build on X32, where long is 32-bit rather than 64-bit. 6This fixes the build on X32, where long is 32-bit rather than 64-bit.
7 7
8Signed-off-by: Christopher Larson <chris_larson@mentor.com> 8Signed-off-by: Christopher Larson <chris_larson@mentor.com>
9Signed-off-by: Dengke Du <dengke.du@windriver.com>
9--- 10---
10 testcases/kernel/syscalls/fcntl/fcntl14.c | 2 +- 11 testcases/kernel/syscalls/fcntl/fcntl14.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-) 12 1 file changed, 1 insertion(+), 1 deletion(-)
12 13
13diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c 14diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
14index 3b36572..65ac8fa 100644 15index c61eb24..99e3867 100644
15--- a/testcases/kernel/syscalls/fcntl/fcntl14.c 16--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
16+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c 17+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
17@@ -789,7 +789,7 @@ void dochild(void) 18@@ -775,7 +775,7 @@ void dochild(void)
18 19
19 void run_test(int file_flag, int file_mode, int seek, int start, int end) 20 void run_test(int file_flag, int file_mode, int seek, int start, int end)
20 { 21 {
21- extern long time(); 22- extern long time();
22+ extern time_t time(); 23+ extern time_t time();
23 24
24 /* reset fail to 0 for each run_test call */
25 fail = 0; 25 fail = 0;
26
26-- 27--
272.8.0 282.7.4
28 29
diff --git a/meta/recipes-extended/ltp/ltp/0040-containers-userns05-use-unsigned-int-for-ns-id.patch b/meta/recipes-extended/ltp/ltp/0040-containers-userns05-use-unsigned-int-for-ns-id.patch
deleted file mode 100644
index 4dee1f5a9b..0000000000
--- a/meta/recipes-extended/ltp/ltp/0040-containers-userns05-use-unsigned-int-for-ns-id.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 3b63d350e9fe9e4271916cc0abfac65a5d6419ff Mon Sep 17 00:00:00 2001
2From: Jiri Jaburek <jjaburek@redhat.com>
3Date: Tue, 7 Feb 2017 07:58:16 +0000
4Subject: [PATCH] containers/userns05: use unsigned int for ns id
5
6The kernel defines it as 'unsigned int' in 'struct ns_common'
7and formats it as
8
9 snprintf(buf, size, "%s:[%u]", ns_ops->name, ns->inum);
10
11This change makes the test work on 32bit systems where LONG_MAX
12is smaller than UINT_MAX.
13
14Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
15
16Upstream-Status: Backport
17
18Signed-off-by: He Zhe <zhe.he@windriver.com>
19---
20 testcases/kernel/containers/userns/userns05.c | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
22
23diff --git a/testcases/kernel/containers/userns/userns05.c b/testcases/kernel/containers/userns/userns05.c
24index 8d8c40a..8eac729 100644
25--- a/testcases/kernel/containers/userns/userns05.c
26+++ b/testcases/kernel/containers/userns/userns05.c
27@@ -49,18 +49,18 @@ static int child_fn1(void)
28 return 0;
29 }
30
31-static long getusernsidbypid(int pid)
32+static unsigned int getusernsidbypid(int pid)
33 {
34 char path[BUFSIZ];
35 char userid[BUFSIZ];
36- long id = 0;
37+ unsigned int id = 0;
38
39 sprintf(path, "/proc/%d/ns/user", pid);
40
41 if (readlink(path, userid, BUFSIZ) == -1)
42 tst_resm(TFAIL | TERRNO, "readlink failure.");
43
44- if (sscanf(userid, "user:[%ld]", &id) != 1)
45+ if (sscanf(userid, "user:[%u]", &id) != 1)
46 tst_resm(TFAIL, "sscanf failure.");
47 return id;
48 }
49@@ -68,7 +68,7 @@ static long getusernsidbypid(int pid)
50 static void test_userns_id(void)
51 {
52 int cpid1, cpid2, cpid3;
53- long parentuserns, cpid1userns, cpid2userns, newparentuserns;
54+ unsigned int parentuserns, cpid1userns, cpid2userns, newparentuserns;
55
56 parentuserns = getusernsidbypid(getpid());
57 cpid1 = ltp_clone_quick(SIGCHLD, (void *)child_fn1,
58--
592.9.3
60
diff --git a/meta/recipes-extended/ltp/ltp_20160126.bb b/meta/recipes-extended/ltp/ltp_20170116.bb
index aaa63c268c..a5494bc809 100644
--- a/meta/recipes-extended/ltp/ltp_20160126.bb
+++ b/meta/recipes-extended/ltp/ltp_20170116.bb
@@ -11,9 +11,6 @@ LIC_FILES_CHKSUM = "\
11 file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \ 11 file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
12 file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \ 12 file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \
13 file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ 13 file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
14 file://tools/netpipe-2.4/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
15 file://tools/netpipe-2.4-ipv6/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
16 file://tools/top-LTP/proc/COPYING;md5=aefc88eb8a41672fbfcfe6b69ab8c49c \
17 file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ 14 file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
18 file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ 15 file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
19 file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \ 16 file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
@@ -24,49 +21,36 @@ DEPENDS_append_libc-musl = " fts "
24EXTRA_OEMAKE_append_libc-musl = " LIBC=musl " 21EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
25CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__" 22CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
26CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__" 23CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
27SRCREV = "fce797676b14f50406718e7ef640b50da66c9b36" 24SRCREV = "2c8457b0769fc026e4e1772f4c2a6da0be63a631"
28 25
29SRC_URI = "git://github.com/linux-test-project/ltp.git \ 26SRC_URI = "git://github.com/linux-test-project/ltp.git \
30 file://0001-ltp-Don-t-link-against-libfl.patch \ 27 file://0001-add-_GNU_SOURCE-to-pec_listener.c.patch \
31 file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \ 28 file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \
32 file://0003-Add-knob-to-control-tirpc-support.patch \ 29 file://0003-Add-knob-to-control-tirpc-support.patch \
33 file://0004-build-Add-option-to-select-libc-implementation.patch \ 30 file://0004-build-Add-option-to-select-libc-implementation.patch \
34 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \ 31 file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
35 file://0006-sendfile-Use-off64_t-instead-of-__off64_t.patch \ 32 file://0006-fix-PATH_MAX-undeclared-when-building-with-musl.patch \
36 file://0007-replace-SIGCLD-with-SIGCHLD.patch \ 33 file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \
37 file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \ 34 file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
38 file://0009-Guard-error.h-with-__GLIBC__.patch \ 35 file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \
39 file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \ 36 file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
40 file://0011-Rename-sigset-variable-to-sigset1.patch \ 37 file://0011-Rename-sigset-variable-to-sigset1.patch \
41 file://0012-fsstress.c-Replace-__int64_t-with-int64_t.patch \ 38 file://0012-fix-faccessat01.c-build-fails-with-security-flags.patch \
42 file://0013-include-fcntl.h-for-getting-O_-definitions.patch \
43 file://0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch \
44 file://0015-mincore01-Rename-PAGESIZE-to-pagesize.patch \
45 file://0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch \
46 file://0017-replace-sigval_t-with-union-sigval.patch \
47 file://0018-guard-mallocopt-with-__GLIBC__.patch \ 39 file://0018-guard-mallocopt-with-__GLIBC__.patch \
48 file://0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch \
49 file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \ 40 file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
50 file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \ 41 file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
51 file://0022-include-sys-types.h.patch \
52 file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \ 42 file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
53 file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \ 43 file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
54 file://0025-mc_gethost-include-sys-types.h.patch \ 44 file://0025-mc_gethost-include-sys-types.h.patch \
55 file://0026-crash01-Define-_GNU_SOURCE.patch \ 45 file://0026-crash01-Define-_GNU_SOURCE.patch \
56 file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \ 46 file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
57 file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \ 47 file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
58 file://0029-trace_shed-Fix-build-with-musl.patch \
59 file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \ 48 file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
60 file://0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch \
61 file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
62 file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \ 49 file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
63 file://0034-periodic_output.patch \ 50 file://0034-periodic_output.patch \
64 file://0035-fix-test_proc_kill-hang.patch \ 51 file://0035-fix-test_proc_kill-hang.patch \
65 file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \ 52 file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
66 file://0037-containers-netns_netlink-Avoid-segmentation-fault.patch \
67 file://0038-run-posix-option-group-test-replace-CWD-qith-PWD.patch \
68 file://0039-fcntl-fix-the-time-def-to-use-time_t.patch \ 53 file://0039-fcntl-fix-the-time-def-to-use-time_t.patch \
69 file://0040-containers-userns05-use-unsigned-int-for-ns-id.patch \
70 " 54 "
71 55
72S = "${WORKDIR}/git" 56S = "${WORKDIR}/git"
@@ -104,13 +88,16 @@ do_install(){
104 # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible 88 # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible
105 rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl 89 rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl
106 90
91 # In oe-core, we doesn't support ksh and csh now, so remove in.csh and in.ksh.
92 rm ${D}/opt/ltp/testcases/data/file01/in.csh
93 rm ${D}/opt/ltp/testcases/data/file01/in.ksh
107 # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual 94 # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
108 cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases 95 cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
109} 96}
110 97
111RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd" 98RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd unzip gzip cpio cronie logrotate which at"
112 99
113FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a" 100FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a /opt/ltp/testcases/data/nm01/lib.a"
114 101
115FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*" 102FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*"
116 103