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>
// 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.