runtime: Update open/close/read/write to return -1 on error.

Error detection code copied from syscall, where presumably
we actually do it right.

Note that we throw the errno away.  The runtime doesn't use it.

Fixes #10052

Change-Id: I8de77dda6bf287276b137646c26b84fa61554ec8
Reviewed-on: https://go-review.googlesource.com/6571
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Keith Randall 2015-03-02 20:16:48 -08:00
parent 74e88dfdee
commit f584c05fcc
21 changed files with 187 additions and 1 deletions

View file

@ -117,3 +117,8 @@ var Gostringnocopy = gostringnocopy
var Maxstring = &maxstring
type Uintreg uintreg
var Open = open
var Close = close
var Read = read
var Write = write