From: James Hogan Date: Wed, 1 May 2013 12:16:49 +0000 (+0100) Subject: test/skodic: make a bit more portable X-Git-Tag: v4.8~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cf23c53b8a96269ef72b6d675c811c8132ae5ec;p=strace test/skodic: make a bit more portable * test/skodic.c (main): 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 by open call is 3 when passing it to mmap. Signed-off-by: James Hogan --- diff --git a/test/skodic.c b/test/skodic.c index cfb935ed..4dcd9556 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()) {