]> Cypherpunks repositories - gostls13.git/commitdiff
internal/poll: implement RawControl of FD on Windows
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 19 May 2017 09:49:28 +0000 (18:49 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Sat, 20 May 2017 00:45:11 +0000 (00:45 +0000)
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>
src/internal/poll/fd_windows.go

index 5c55c948c233c601bfb2c9275007b933d1e730ad..9f40886d08b074ba47cd9f15c466547a891455d3 100644 (file)
@@ -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.