]> Cypherpunks repositories - gostls13.git/commit
runtime: correct return value checks for mmap on darwin/freebsd
authorJoel Sing <jsing@google.com>
Fri, 22 Mar 2013 15:17:01 +0000 (02:17 +1100)
committerJoel Sing <jsing@google.com>
Fri, 22 Mar 2013 15:17:01 +0000 (02:17 +1100)
commit3b9702c9c8a7e69e5af9b6dafd2932228d6b3210
treedf27c5ec5ceefb0a96b72b0f2101476b0ee26e1a
parent28f65bf4a2ca23701f3c24c866b02bc473c0dd1e
runtime: correct return value checks for mmap on darwin/freebsd

On Darwin and FreeBSD, the mmap syscall return value is returned
unmodified. This means that the return value will either be a
valid address or a positive error number.

Also check return value from mmap in SysReserve - the callers of
SysReserve expect nil to be returned if the allocation failed.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7871043
src/pkg/runtime/mem_darwin.c
src/pkg/runtime/mem_freebsd.c