summaryrefslogtreecommitdiff
path: root/malloc/tst-valloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-02-22 05:25:08 +0000
committerUlrich Drepper <drepper@redhat.com>2000-02-22 05:25:08 +0000
commit68e8dcc78f6b52d32a02c8b18eb25f753a232070 (patch)
tree303202bcda2196dc7b8f0bf84489ed6dc9cbcb78 /malloc/tst-valloc.c
parentbfaf0bbb7d2b7a1adbcc1e61625bd5ea29547fac (diff)
Update.
2000-02-21 Ulrich Drepper <drepper@redhat.com> * malloc/Makefile (tests): Add tst-valloc. * malloc/tst-valloc.c: New file.
Diffstat (limited to 'malloc/tst-valloc.c')
-rw-r--r--malloc/tst-valloc.c21
1 files changed, 21 insertions, 0 deletions
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 <sct@redhat.com>. */
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+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;
+}