]> granicus.if.org Git - strace/commitdiff
test/skodic: make a bit more portable
authorJames Hogan <james.hogan@imgtec.com>
Wed, 1 May 2013 12:16:49 +0000 (13:16 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 1 May 2013 14:54:05 +0000 (14:54 +0000)
* 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 <james.hogan@imgtec.com>
test/skodic.c

index cfb935edd58f1d1f585721556e553ae6e975d00e..4dcd955661062752409abf28b16adae00cf79633 100644 (file)
 
 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()) {