aboutsummaryrefslogtreecommitdiff
path: root/string/test-string.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-25 00:17:34 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-25 00:17:34 +0000
commitf63abf584cc5028c89edd2352e7abacdd223c114 (patch)
treea26a6bc5d9277e8ea6ff5e209551c5bb2277bb58 /string/test-string.h
parentb5ba2c790c505ede186cd2898453b0dccf827e2f (diff)
downloadglibc-f63abf584cc5028c89edd2352e7abacdd223c114.zip
glibc-f63abf584cc5028c89edd2352e7abacdd223c114.tar.gz
glibc-f63abf584cc5028c89edd2352e7abacdd223c114.tar.bz2
* string/Makefile (strop-tests): Add memmem.
* string/test-memmem.c: New file. * string/test-string.h (BUF1PAGES): Define to 1 if undefined. (test_init): Size buf1 according to BUF1PAGES. * stdio-common/scanf16.c: New file. * stdio-common/scanf17.c: New file. * scripts/data/localplt-sparc64-linux-gnu.data: New file.
Diffstat (limited to 'string/test-string.h')
-rw-r--r--string/test-string.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/string/test-string.h b/string/test-string.h
index 381c140..1aea4c9 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -1,5 +1,5 @@
/* Test and measure string and memory functions.
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -118,6 +118,10 @@ size_t iterations = 100000;
} \
while (0)
+#ifndef BUF1PAGES
+# define BUF1PAGES 1
+#endif
+
static void
test_init (void)
{
@@ -126,11 +130,11 @@ test_init (void)
if (page_size < MIN_PAGE_SIZE)
page_size = MIN_PAGE_SIZE;
#endif
- buf1 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
+ buf1 = mmap (0, (BUF1PAGES + 1) * page_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
if (buf1 == MAP_FAILED)
error (EXIT_FAILURE, errno, "mmap failed");
- if (mprotect (buf1 + page_size, page_size, PROT_NONE))
+ if (mprotect (buf1 + BUF1PAGES * page_size, page_size, PROT_NONE))
error (EXIT_FAILURE, errno, "mprotect failed");
buf2 = mmap (0, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
@@ -145,7 +149,7 @@ test_init (void)
srandom (seed);
}
- memset (buf1, 0xa5, page_size);
+ memset (buf1, 0xa5, BUF1PAGES * page_size);
memset (buf2, 0x5a, page_size);
}