blob: 6b6d1acf997dbca19a00ac6e6e93fa3f1306c384 [file] [log] [blame]
/*
* mmaptest.c
*
* Test some simple cases of mmap()
*/
#include <sys/mman.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#include <sys/syscall.h>
int main(int argc, char *argv[])
{
void *foo;
/* Important case, this is how we get memory for malloc() */
errno = 0;
foo = mmap(0, 65536, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
printf("mmap() returned %p, errno = %d\n", foo, errno);
return 0;
}