| 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. |
| 4 |
|
| 5 |
package poll |
| 6 |
|
| 7 |
import "syscall" |
| 8 |
|
| 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 |
| 13 |
} |
| 14 |
defer fd.decref() |
| 15 |
return syscall.Setsockopt(fd.Sysfd, level, optname, optval, optlen) |
| 16 |
} |
| 17 |
|
| 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 |
| 22 |
} |
| 23 |
defer fd.decref() |
| 24 |
return syscall.WSAIoctl(fd.Sysfd, iocc, inbuf, cbif, outbuf, cbob, cbbr, overlapped, completionRoutine) |
| 25 |
} |