summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch')
-rw-r--r--meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch113
1 files changed, 0 insertions, 113 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch b/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
deleted file mode 100644
index c8738ae0d4..0000000000
--- a/meta/recipes-extended/ltp/ltp/0037-ltp-fix-PAGE_SIZE-redefinition-and-O_CREAT-undeclear.patch
+++ /dev/null
@@ -1,113 +0,0 @@
1From a9d5595d2fa2ab252f1cabf63f4b65c3efbafeb9 Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Thu, 10 Aug 2017 15:27:03 +0800
4Subject: [PATCH] ltp: fix PAGE_SIZE redefinition and O_CREAT undeclear when
5 build with musl
6
7error 1:
8
9|stack_clash.c:50:22: error: expected identifier or '(' before numeric constant
10| static unsigned long PAGE_SIZE;
11
12This is because the musl libc already contain PAGE_SIZE definition in limits.c,
13we can check it here:
14
15 https://git.musl-libc.org/cgit/musl/tree/include/limits.h#n43
16
17error 2:
18
19|ck01.c:157:22: error: 'O_CREAT' undeclared (first use in this function); did you mean 'S_IREAD'?
20| fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0644);
21| ^~~~~~~
22| S_IREAD
23
24This is because the musl libc put those in fcntl.h, so we should include that
25file.
26
27Upstream-Status: Submitted [ https://github.com/linux-test-project/ltp/pull/194 ]
28
29Signed-off-by: Dengke Du <dengke.du@windriver.com>
30---
31 testcases/cve/stack_clash.c | 12 ++++++------
32 testcases/kernel/syscalls/flock/flock01.c | 1 +
33 testcases/kernel/syscalls/flock/flock02.c | 1 +
34 3 files changed, 8 insertions(+), 6 deletions(-)
35
36diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c
37index 2ef1a82..7c45991 100644
38--- a/testcases/cve/stack_clash.c
39+++ b/testcases/cve/stack_clash.c
40@@ -47,7 +47,7 @@
41 #include "tst_test.h"
42 #include "tst_safe_stdio.h"
43
44-static unsigned long PAGE_SIZE;
45+static unsigned long PAGE_SIZE_tst;
46 static unsigned long PAGE_MASK;
47 static unsigned long GAP_PAGES = 256;
48 static unsigned long THRESHOLD;
49@@ -66,7 +66,7 @@ void exhaust_stack_into_sigsegv(void)
50 exhaust_stack_into_sigsegv();
51 }
52
53-#define MAPPED_LEN PAGE_SIZE
54+#define MAPPED_LEN PAGE_SIZE_tst
55 static unsigned long mapped_addr;
56
57 void segv_handler(int sig, siginfo_t *info, void *data LTP_ATTRIBUTE_UNUSED)
58@@ -150,7 +150,7 @@ void do_child(void)
59 stack_t signal_stack;
60 struct sigaction segv_sig = {.sa_sigaction = segv_handler, .sa_flags = SA_ONSTACK|SA_SIGINFO};
61 void *map;
62- unsigned long gap = GAP_PAGES * PAGE_SIZE;
63+ unsigned long gap = GAP_PAGES * PAGE_SIZE_tst;
64 struct rlimit rlimit;
65
66 rlimit.rlim_cur = rlimit.rlim_max = RLIM_INFINITY;
67@@ -200,8 +200,8 @@ void setup(void)
68 {
69 char buf[4096], *p;
70
71- PAGE_SIZE = sysconf(_SC_PAGESIZE);
72- PAGE_MASK = ~(PAGE_SIZE - 1);
73+ PAGE_SIZE_tst = sysconf(_SC_PAGESIZE);
74+ PAGE_MASK = ~(PAGE_SIZE_tst - 1);
75
76 buf[4095] = '\0';
77 SAFE_FILE_SCANF("/proc/cmdline", "%4095[^\n]", buf);
78@@ -214,7 +214,7 @@ void setup(void)
79 tst_res(TINFO, "stack_guard_gap = %ld", GAP_PAGES);
80 }
81
82- THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE;
83+ THRESHOLD = (GAP_PAGES - 1) * PAGE_SIZE_tst;
84
85 {
86 volatile int *a = alloca(128);
87diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c
88index 3e17be4..06d89e3 100644
89--- a/testcases/kernel/syscalls/flock/flock01.c
90+++ b/testcases/kernel/syscalls/flock/flock01.c
91@@ -69,6 +69,7 @@
92 #include <stdio.h>
93 #include <sys/wait.h>
94 #include <sys/file.h>
95+#include <fcntl.h>
96 #include "test.h"
97
98 void setup(void);
99diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c
100index 414df68..9ddf729 100644
101--- a/testcases/kernel/syscalls/flock/flock02.c
102+++ b/testcases/kernel/syscalls/flock/flock02.c
103@@ -75,6 +75,7 @@
104 #include <sys/types.h>
105 #include <sys/file.h>
106 #include <sys/wait.h>
107+#include <fcntl.h>
108 #include <errno.h>
109 #include <stdio.h>
110 #include "test.h"
111--
1122.7.4
113