Commit e786829e authored by Sébastien Paolacci's avatar Sébastien Paolacci Committed by Russ Cox

runtime: handle locked mmap failure on Linux

Used to then die on a nil pointer situation. Most Linux standard setups are rather
restrictive regarding the default amount of lockable memory.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6997049
parent 975bf6d3
......@@ -10,6 +10,7 @@
enum
{
EAGAIN = 11,
ENOMEM = 12,
_PAGE_SIZE = 4096,
};
......@@ -63,6 +64,10 @@ runtime·SysAlloc(uintptr n)
runtime·printf("if you're running SELinux, enable execmem for this process.\n");
runtime·exit(2);
}
if(p == (void*)EAGAIN) {
runtime·printf("runtime: mmap: too much locked memory (check 'ulimit -l').\n");
runtime·exit(2);
}
return nil;
}
return p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment