diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2009-01-03 19:22:16 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2009-01-03 19:22:16 +0000 |
commit | 91aabc8dd2b80c5185789d4746c2c040ac9c9237 (patch) | |
tree | 19a5975324c457c3174484af74732dc5ceea6211 /sim | |
parent | a349c9b6a2c7d2fb15400454969659d441679c83 (diff) | |
download | gdb-91aabc8dd2b80c5185789d4746c2c040ac9c9237.zip gdb-91aabc8dd2b80c5185789d4746c2c040ac9c9237.tar.gz gdb-91aabc8dd2b80c5185789d4746c2c040ac9c9237.tar.bz2 |
* sim/cris/c/mmap1.c (MMAP_FLAGS): Default-define to
MAP_PRIVATE and use this macro in the mmap call.
* sim/cris/c/mmap4.c: New test.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | sim/testsuite/sim/cris/c/mmap1.c | 6 | ||||
-rw-r--r-- | sim/testsuite/sim/cris/c/mmap4.c | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog index d5bc103..6bf8ccb 100644 --- a/sim/testsuite/ChangeLog +++ b/sim/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2009-01-03 Hans-Peter Nilsson <hp@axis.com> + * sim/cris/c/mmap1.c (MMAP_FLAGS): Default-define to + MAP_PRIVATE and use this macro in the mmap call. + * sim/cris/c/mmap4.c: New test. * sim/cris/c/access1.c: New test. * sim/cris/asm/pid1.ms: New test. diff --git a/sim/testsuite/sim/cris/c/mmap1.c b/sim/testsuite/sim/cris/c/mmap1.c index b803f0c..9db94c1 100644 --- a/sim/testsuite/sim/cris/c/mmap1.c +++ b/sim/testsuite/sim/cris/c/mmap1.c @@ -38,7 +38,11 @@ int main (int argc, char *argv[]) if ((size & 8191) == 0) size--; - a = mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); +#ifndef MMAP_FLAGS +#define MMAP_FLAGS MAP_PRIVATE +#endif + + a = mmap (NULL, size, PROT_READ, MMAP_FLAGS, fd, 0); if (memmem (a, size, str, strlen (str) + 1) == NULL) abort (); diff --git a/sim/testsuite/sim/cris/c/mmap4.c b/sim/testsuite/sim/cris/c/mmap4.c new file mode 100644 index 0000000..b3a66e4 --- /dev/null +++ b/sim/testsuite/sim/cris/c/mmap4.c @@ -0,0 +1,5 @@ +/* Just check that MAP_DENYWRITE is "honored" (ignored). +#notarget: cris*-*-elf +*/ +#define MMAP_FLAGS (MAP_PRIVATE|MAP_DENYWRITE) +#include "mmap1.c" |