1 /* _PDCLIB_allocpages( int const )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 /* This is an example implementation of _PDCLIB_allocpages() (declared in
8 _PDCLIB_config.h), fit for use with POSIX kernels.
18 #include <_PDCLIB_glue.h>
21 #define MAP_ANON MAP_ANOYNMOUS
24 void * _PDCLIB_allocpages( size_t n )
27 NULL, n * _PDCLIB_MALLOC_PAGESIZE, PROT_READ | PROT_WRITE,
28 MAP_ANON | MAP_PRIVATE, -1, 0);
30 if(addr != MAP_FAILED) {
40 #include <_PDCLIB_test.h>