]> Cypherpunks repositories - gostls13.git/commit
runtime: fix errno sign for some mmap and mincore cases
authorIan Lance Taylor <iant@golang.org>
Thu, 11 Feb 2016 05:46:51 +0000 (21:46 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 12 Feb 2016 00:07:29 +0000 (00:07 +0000)
commitcc0a04d351c69a99f65342ad5822f2bba8b247d0
tree3e63e89cae82b60fcddf77d2e7672b0cb747f6f4
parent70418eb819eb1d02c2c56a13159d95baab85d3a8
runtime: fix errno sign for some mmap and mincore cases

The caller of mmap expects it to return a positive errno value, but the
linux-arm64 and nacl-386 system calls returned a negative errno value.
Correct them to negate the errno value.

The caller of mincore expects it to return a negative errno value (yes,
this is inconsistent), but the linux-mips64x and linux-ppc64x system
call returned a positive errno value.  Correct them to negate the errno
value.

Add a test that mmap returns errno with the correct sign.  Brad added a
test for mincore's errno value in https://golang.org/cl/19457.

Fixes #14297.

Change-Id: I2b93f32e679bd1eae1c9aef9ae7bcf0ba39521b5
Reviewed-on: https://go-review.googlesource.com/19455
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/export_linux_test.go
src/runtime/export_mmap_test.go [new file with mode: 0644]
src/runtime/export_test.go
src/runtime/mem_bsd.go
src/runtime/os2_nacl.go
src/runtime/runtime_mmap_test.go [new file with mode: 0644]
src/runtime/sys_linux_arm64.s
src/runtime/sys_linux_mips64x.s
src/runtime/sys_linux_ppc64x.s
src/runtime/sys_nacl_386.s