chiark / gitweb /
[PATCH] update klibc to version 0.181
[elogind.git] / klibc / klibc / tests / mmaptest.c
1 /*
2  * mmaptest.c
3  *
4  * Test some simple cases of mmap()
5  */
6
7 #include <sys/mman.h>
8 #include <unistd.h>
9 #include <stdio.h>
10 #include <errno.h>
11 #include <stdint.h>
12 #include <sys/syscall.h>
13
14 int main(int argc, char *argv[])
15 {
16   void *foo;
17
18   (void)argc; (void)argv;
19
20   /* Important case, this is how we get memory for malloc() */
21   errno = 0;
22   foo = mmap(0, 65536, PROT_READ|PROT_WRITE,
23              MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
24
25   printf("mmap() returned %p, errno = %d\n", foo, errno);
26
27   return 0;
28 }