aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2017-05-19 18:49:28 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2017-05-20 00:45:11 +0000
commitfd25fe60fac4014dfe09c364c8c73ff2c95251e5 (patch)
tree8233826ccd10413c40cd117a1717341f8136533a
parent15aa04d200881fac553ff8ad44fc62b6cb60e7d2 (diff)
downloadgo-fd25fe60fac4014dfe09c364c8c73ff2c95251e5.tar.xz
internal/poll: implement RawControl of FD on Windows
This is a followup to https://go-review.googlesource.com/37038. Updates #19435. Change-Id: If3d56bca0e8816d1a169f5cf97f27b20695a9955 Reviewed-on: https://go-review.googlesource.com/43692 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/internal/poll/fd_windows.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internal/poll/fd_windows.go b/src/internal/poll/fd_windows.go
index 5c55c948c2..9f40886d08 100644
--- a/src/internal/poll/fd_windows.go
+++ b/src/internal/poll/fd_windows.go
@@ -837,7 +837,12 @@ func (fd *FD) GetFileInformationByHandle(data *syscall.ByHandleFileInformation)
// RawControl invokes the user-defined function f for a non-IO
// operation.
func (fd *FD) RawControl(f func(uintptr)) error {
- return errors.New("not implemented")
+ if err := fd.incref(); err != nil {
+ return err
+ }
+ defer fd.decref()
+ f(uintptr(fd.Sysfd))
+ return nil
}
// RawRead invokes the user-defined function f for a read operation.