diff options
author | James Hogan <james.hogan@imgtec.com> | 2013-05-01 13:16:49 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2013-05-01 14:54:05 +0000 |
commit | 5cf23c53b8a96269ef72b6d675c811c8132ae5ec (patch) | |
tree | 1b0bebcfca65e5832603d10828fb0e658673dfc1 /test | |
parent | 6303f357793be8be7860cf257fed0efd427c0f98 (diff) | |
download | strace-5cf23c53b8a96269ef72b6d675c811c8132ae5ec.tar.gz strace-5cf23c53b8a96269ef72b6d675c811c8132ae5ec.tar.bz2 strace-5cf23c53b8a96269ef72b6d675c811c8132ae5ec.tar.xz |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/skodic.c | 7 |
1 files 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()) { |