gcc/libgo/go/os/rawconn.go
Ian Lance Taylor 4f4a855d82 libgo: update to Go1.12beta2
Reviewed-on: https://go-review.googlesource.com/c/158019

gotools/:
	* Makefile.am (go_cmd_vet_files): Update for Go1.12beta2 release.
	(GOTOOLS_TEST_TIMEOUT): Increase to 600.
	(check-runtime): Export LD_LIBRARY_PATH before computing GOARCH
	and GOOS.
	(check-vet): Copy golang.org/x/tools into check-vet-dir.
	* Makefile.in: Regenerate.

gcc/testsuite/:
	* go.go-torture/execute/names-1.go: Stop using debug/xcoff, which
	is no longer externally visible.

From-SVN: r268084
2019-01-18 19:04:36 +00:00

48 lines
992 B
Go

// Copyright 2018 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 !plan9
package os
import (
"runtime"
)
// rawConn implements syscall.RawConn.
type rawConn struct {
file *File
}
func (c *rawConn) Control(f func(uintptr)) error {
if err := c.file.checkValid("SyscallConn.Control"); err != nil {
return err
}
err := c.file.pfd.RawControl(f)
runtime.KeepAlive(c.file)
return err
}
func (c *rawConn) Read(f func(uintptr) bool) error {
if err := c.file.checkValid("SyscallConn.Read"); err != nil {
return err
}
err := c.file.pfd.RawRead(f)
runtime.KeepAlive(c.file)
return err
}
func (c *rawConn) Write(f func(uintptr) bool) error {
if err := c.file.checkValid("SyscallConn.Write"); err != nil {
return err
}
err := c.file.pfd.RawWrite(f)
runtime.KeepAlive(c.file)
return err
}
func newRawConn(file *File) (*rawConn, error) {
return &rawConn{file: file}, nil
}