aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2012-12-12 01:20:42 -0500
committerChen, Gong <gong.chen@linux.intel.com>2015-01-21 21:24:00 -0500
commit5dfeba607e52283ede30b0fb90add8fc3e06d227 (patch)
tree6a75856c5bb244d67c3a57e8f7ef3b3f9e721d04
parentdbaa5de857a8156ab3c09f42d4a3976297bbbb2a (diff)
downloadmce-test-5dfeba607e52283ede30b0fb90add8fc3e06d227.tar.gz
mce-test: Fix pread and MAP_ANONYMOUS usage
_XOPEN_SOURCE=500 must be defined for pread but this will result in MAP_ANONYMOUS not being defined -> also define _BSD_SOURCE for MAP_ANONYMOUS Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rw-r--r--cases/function/core_recovery/Makefile5
-rw-r--r--cases/function/pfa/Makefile5
2 files changed, 8 insertions, 2 deletions
diff --git a/cases/function/core_recovery/Makefile b/cases/function/core_recovery/Makefile
index 1b59dd1..c18edf1 100644
--- a/cases/function/core_recovery/Makefile
+++ b/cases/function/core_recovery/Makefile
@@ -1,4 +1,7 @@
-CFLAGS := -Wall
+# pread needs:
+# _XOPEN_SOURCE >= 500 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
+# but this hides MAP_ANONYMOUS which comes back via _BSD_SOURCE
+CFLAGS := -Wall -D _BSD_SOURCE -D _XOPEN_SOURCE=500
core_recovery: core_recovery.o
diff --git a/cases/function/pfa/Makefile b/cases/function/pfa/Makefile
index 26dc574..4bcbf48 100644
--- a/cases/function/pfa/Makefile
+++ b/cases/function/pfa/Makefile
@@ -1,4 +1,7 @@
-CFLAGS := -g -Wall
+# pread needs:
+# _XOPEN_SOURCE >= 500 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
+# but this hides MAP_ANONYMOUS which comes back via _BSD_SOURCE
+CFLAGS := -g -Wall -D _BSD_SOURCE -D _XOPEN_SOURCE=500
all: pfa busy
pfa: pfa.o