From 68e8dcc78f6b52d32a02c8b18eb25f753a232070 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 22 Feb 2000 05:25:08 +0000 Subject: [PATCH] Update. 2000-02-21 Ulrich Drepper * malloc/Makefile (tests): Add tst-valloc. * malloc/tst-valloc.c: New file. --- ChangeLog | 5 +++++ malloc/Makefile | 4 ++-- malloc/tst-valloc.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 malloc/tst-valloc.c diff --git a/ChangeLog b/ChangeLog index e00dcf36fe..b975b7554f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-02-21 Ulrich Drepper + + * malloc/Makefile (tests): Add tst-valloc. + * malloc/tst-valloc.c: New file. + 2000-02-21 Andreas Jaeger * sysdeps/unix/sysv/linux/bits/in.h (IPV6_RXSRCRT): Renamed to diff --git a/malloc/Makefile b/malloc/Makefile index b06cf41d85..53094ac560 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. +# Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ all: dist-headers := malloc.h headers := $(dist-headers) obstack.h mcheck.h -tests := mallocbug tst-malloc +tests := mallocbug tst-malloc tst-valloc distribute = thread-m.h mtrace.pl mcheck-init.c stackinfo.h memprof.h diff --git a/malloc/tst-valloc.c b/malloc/tst-valloc.c new file mode 100644 index 0000000000..7958d51822 --- /dev/null +++ b/malloc/tst-valloc.c @@ -0,0 +1,21 @@ +/* Test case by Stephen Tweedie . */ +#include +#include +#include + +int main(void) +{ + char *p; + int pagesize = getpagesize (); + int i; + + p = valloc (pagesize); + i = (int) p; + + if ((i & (pagesize-1)) != 0) { + fprintf (stderr, "Alignment problem: valloc returns %p\n", p); + exit(1); + } + + return 0; +}