From f63abf584cc5028c89edd2352e7abacdd223c114 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 25 May 2008 00:17:34 +0000 Subject: * 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. --- string/test-string.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'string/test-string.h') diff --git a/string/test-string.h b/string/test-string.h index 381c140d9f..1aea4c9cb9 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 , 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); } -- cgit 1.4.1