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 <james.hogan@imgtec.com>
This commit is contained in:
James Hogan 2013-05-01 13:16:49 +01:00 committed by Dmitry V. Levin
parent 6303f35779
commit 5cf23c53b8

View File

@ -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()) {