libgo: update to go1.9
[official-gcc.git] / libgo / go / internal / poll / sockopt_windows.go
blobdd5fb70babd38a098a052e174c4b1f82a91e2242
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package poll
7 import "syscall"
9 // Setsockopt wraps the setsockopt network call.
10 func (fd *FD) Setsockopt(level, optname int32, optval *byte, optlen int32) error {
11 if err := fd.incref(); err != nil {
12 return err
14 defer fd.decref()
15 return syscall.Setsockopt(fd.Sysfd, level, optname, optval, optlen)
18 // WSAIoctl wraps the WSAIoctl network call.
19 func (fd *FD) WSAIoctl(iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *syscall.Overlapped, completionRoutine uintptr) error {
20 if err := fd.incref(); err != nil {
21 return err
23 defer fd.decref()
24 return syscall.WSAIoctl(fd.Sysfd, iocc, inbuf, cbif, outbuf, cbob, cbbr, overlapped, completionRoutine)