Back to index

glibc  2.9
tst-valloc.c
Go to the documentation of this file.
00001 /* Test case by Stephen Tweedie <sct@redhat.com>.  */
00002 #include <unistd.h>
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 
00006 int
00007 main (void)
00008 {
00009   char *p;
00010   int pagesize = getpagesize ();
00011   int i;
00012 
00013   p = valloc (pagesize);
00014   i = (long int) p;
00015 
00016   if ((i & (pagesize-1)) != 0)
00017     {
00018       fprintf (stderr, "Alignment problem: valloc returns %p\n", p);
00019       exit (1);
00020     }
00021 
00022   return 0;
00023 }