[PATCH 1/2] test/skodic: make a bit more portable

James Hogan james.hogan at imgtec.com
Wed May 1 12:16:49 UTC 2013


Make test/skodic a little bit more portable. Don't use MAP_FIXED since
valid virtual addresses vary between architectures (as far as I can tell
the use of MAP_FIXED is not relevant to the test). Also don't assume the
file desriptor returned from the open call is 3 when passing it to mmap.

Signed-off-by: James Hogan <james.hogan at imgtec.com>
---
 test/skodic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/skodic.c b/test/skodic.c
index cfb935e..4dcd955 100644
--- a/test/skodic.c
+++ b/test/skodic.c
@@ -15,12 +15,11 @@
 
 int main(int argc, char *argv[])
 {
-	/* XXX: x86 specific stuff? */
-	char *c = (char*) 0x94000000;
+	char *c;
 	int fd;
 
-	open("/tmp/delme", O_RDWR);
-	mmap(c, 4096, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, 3, 0);
+	fd = open("/tmp/delme", O_RDWR);
+	c = mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	*c = 0;
 
 	if (fork()) {
-- 
1.8.1.2






More information about the Strace-devel mailing list