2 /* Code to test reasonable response to out-of-memory condition
3 * of regular processes.
18 int main (int argc
, char *argv
[])
24 static void *addrs
[NADDRS
];
28 if((f
=fork()) == -1) {
34 /* child: use up as much memory as we can */
35 while((addrs
[i
++ % NADDRS
] = minix_mmap(0, LEN
, PROT_READ
|PROT_WRITE
,
36 MAP_PREALLOC
|MAP_CONTIG
|MAP_ANON
, -1, 0)) != MAP_FAILED
)
41 /* parent: wait for child */
42 if(waitpid(f
, &st
, 0) < 0)