Mine
public text v1 · immutable#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>
#define I_4M 4194304
int main(int argc, char *argv[])
{
char gc;
long i;
i=0;
while(errno == 0){
printf("%i bytes gemapped\n", i*I_4M);
getchar();
mmap((caddr_t)0, I_4M, PROT_WRITE|PROT_READ, MAP_PRIVATE|MAP_ANON, \
-1, 0);
i++;
}
perror("Stopped");
printf("%i bytes gemapped. einde\n", i*I_4M);
pause();
}