summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/go/os/file_plan9.go
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-04-05 23:30:42 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-04-05 23:30:42 +0000
commit93c73ebcbd73f5436d13ffc41f49a86fc062deb8 (patch)
tree10bf9fb3a1314fc8a1c3b963b4550960718384ad /llgo/third_party/gofrontend/libgo/go/os/file_plan9.go
parent7d39641c805bf3263ffb55a23ecf4bbfd37402c0 (diff)
downloadbcm5719-llvm-93c73ebcbd73f5436d13ffc41f49a86fc062deb8.tar.gz
bcm5719-llvm-93c73ebcbd73f5436d13ffc41f49a86fc062deb8.zip
Roll gofrontend to a6e10414311a
This takes us to Go 1.4. Also includes a couple of changes to the test suite, both in the runtime package: - Disable TestSetPanicOnFault. We cannot support this scenario at all, due to LLVM's lack of non-call exceptions. - Tweak TestFinalizerType. This test only passes with two GC runs. Differential Revision: http://reviews.llvm.org/D8828 llvm-svn: 234134
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/os/file_plan9.go')
-rw-r--r--llgo/third_party/gofrontend/libgo/go/os/file_plan9.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/os/file_plan9.go b/llgo/third_party/gofrontend/libgo/go/os/file_plan9.go
index a804b819731..132594eede9 100644
--- a/llgo/third_party/gofrontend/libgo/go/os/file_plan9.go
+++ b/llgo/third_party/gofrontend/libgo/go/os/file_plan9.go
@@ -25,7 +25,8 @@ type file struct {
dirinfo *dirInfo // nil unless directory being read
}
-// Fd returns the integer Unix file descriptor referencing the open file.
+// Fd returns the integer Plan 9 file descriptor referencing the open file.
+// The file descriptor is valid only until f.Close is called or f is garbage collected.
func (f *File) Fd() uintptr {
if f == nil {
return ^(uintptr(0))
@@ -244,14 +245,14 @@ func (f *File) Sync() (err error) {
// read reads up to len(b) bytes from the File.
// It returns the number of bytes read and an error, if any.
func (f *File) read(b []byte) (n int, err error) {
- return syscall.Read(f.fd, b)
+ return fixCount(syscall.Read(f.fd, b))
}
// pread reads len(b) bytes from the File starting at byte offset off.
// It returns the number of bytes read and the error, if any.
// EOF is signaled by a zero count with err set to nil.
func (f *File) pread(b []byte, off int64) (n int, err error) {
- return syscall.Pread(f.fd, b, off)
+ return fixCount(syscall.Pread(f.fd, b, off))
}
// write writes len(b) bytes to the File.
@@ -262,7 +263,7 @@ func (f *File) write(b []byte) (n int, err error) {
if len(b) == 0 {
return 0, nil
}
- return syscall.Write(f.fd, b)
+ return fixCount(syscall.Write(f.fd, b))
}
// pwrite writes len(b) bytes to the File starting at byte offset off.
@@ -273,7 +274,7 @@ func (f *File) pwrite(b []byte, off int64) (n int, err error) {
if len(b) == 0 {
return 0, nil
}
- return syscall.Pwrite(f.fd, b, off)
+ return fixCount(syscall.Pwrite(f.fd, b, off))
}
// seek sets the offset for the next Read or Write on file to offset, interpreted
OpenPOWER on IntegriCloud