1
2
3
4
5
6
7 package poll
8
9 import "syscall"
10
11
12 func (fd *FD) SetsockoptInt(level, name, arg int) error {
13 if err := fd.incref(); err != nil {
14 return err
15 }
16 defer fd.decref()
17 return syscall.SetsockoptInt(fd.Sysfd, level, name, arg)
18 }
19
20
21 func (fd *FD) SetsockoptInet4Addr(level, name int, arg [4]byte) error {
22 if err := fd.incref(); err != nil {
23 return err
24 }
25 defer fd.decref()
26 return syscall.SetsockoptInet4Addr(fd.Sysfd, level, name, arg)
27 }
28
29
30 func (fd *FD) SetsockoptLinger(level, name int, l *syscall.Linger) error {
31 if err := fd.incref(); err != nil {
32 return err
33 }
34 defer fd.decref()
35 return syscall.SetsockoptLinger(fd.Sysfd, level, name, l)
36 }
37
38
39 func (fd *FD) GetsockoptInt(level, name int) (int, error) {
40 if err := fd.incref(); err != nil {
41 return -1, err
42 }
43 defer fd.decref()
44 return syscall.GetsockoptInt(fd.Sysfd, level, name)
45 }
46
View as plain text