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>2012-12-14 01:18:10 -0500
commit1f30eec487214b5448eb38464e2cc9c137e8579a (patch)
tree6a75856c5bb244d67c3a57e8f7ef3b3f9e721d04
parentc401523f5433467e31ea4fc7fdf94a2c7d7ec04f (diff)
downloadmce-test-1f30eec487214b5448eb38464e2cc9c137e8579a.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