blob: 6c5f3603511b185fd29b9c368b5b126860c5d161 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 8 Jan 2016 07:01:02 +0000
4Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition
5
6musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses
7__USE_GNU
8
9Fixes errors like
10error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013
14Upstream-Status: Pending
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015---
16 testcases/kernel/syscalls/mremap/mremap01.c | 4 +++-
17 testcases/kernel/syscalls/mremap/mremap02.c | 2 ++
18 testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
19 3 files changed, 7 insertions(+), 1 deletion(-)
20
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
22index d63d1e4..24ca174 100644
23--- a/testcases/kernel/syscalls/mremap/mremap01.c
24+++ b/testcases/kernel/syscalls/mremap/mremap01.c
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050025@@ -76,10 +76,12 @@
26 */
27 #include <unistd.h>
28 #include <errno.h>
29+#include <fcntl.h>
30+#define _GNU_SOURCE
31 #define __USE_GNU
32 #include <sys/mman.h>
33 #undef __USE_GNU
34-#include <fcntl.h>
35+#undef _GNU_SOURCE
36
37 #include "test.h"
Brad Bishop316dfdd2018-06-25 12:45:53 -040038 #include "safe_macros.h"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
40index 5a51b9a..a530a6b 100644
41--- a/testcases/kernel/syscalls/mremap/mremap02.c
42+++ b/testcases/kernel/syscalls/mremap/mremap02.c
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050043@@ -75,9 +75,11 @@
44 #include <errno.h>
45 #include <unistd.h>
46 #include <fcntl.h>
47+#define _GNU_SOURCE
48 #define __USE_GNU
49 #include <sys/mman.h>
50 #undef __USE_GNU
51+#undef _GNU_SOURCE
52
53 #include "test.h"
54
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080055diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
56index 12e3829..9b39f8b 100644
57--- a/testcases/kernel/syscalls/mremap/mremap03.c
58+++ b/testcases/kernel/syscalls/mremap/mremap03.c
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059@@ -76,9 +76,11 @@
60 #include <errno.h>
61 #include <unistd.h>
62 #include <fcntl.h>
63+#define _GNU_SOURCE
64 #define __USE_GNU
65 #include <sys/mman.h>
66 #undef __USE_GNU
67+#undef _GNU_SOURCE
68
69 #include "test.h"
70
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071--
722.7.0
73