summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/go/net/fd_posix.go
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/net/fd_posix.go')
-rw-r--r--llgo/third_party/gofrontend/libgo/go/net/fd_posix.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/net/fd_posix.go b/llgo/third_party/gofrontend/libgo/go/net/fd_posix.go
new file mode 100644
index 00000000000..b4b908abacf
--- /dev/null
+++ b/llgo/third_party/gofrontend/libgo/go/net/fd_posix.go
@@ -0,0 +1,21 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris windows
+
+package net
+
+import (
+ "io"
+ "syscall"
+)
+
+// eofError returns io.EOF when fd is available for reading end of
+// file.
+func (fd *netFD) eofError(n int, err error) error {
+ if n == 0 && err == nil && fd.sotype != syscall.SOCK_DGRAM && fd.sotype != syscall.SOCK_RAW {
+ return io.EOF
+ }
+ return err
+}
OpenPOWER on IntegriCloud