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