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 // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
11 // SetsockoptInt wraps the setsockopt network call with an int argument.
12 func (fd
*FD
) SetsockoptInt(level
, name
, arg
int) error
{
13 if err
:= fd
.incref(); err
!= nil {
17 return syscall
.SetsockoptInt(fd
.Sysfd
, level
, name
, arg
)
20 // SetsockoptInet4Addr wraps the setsockopt network call with an IPv4 address.
21 func (fd
*FD
) SetsockoptInet4Addr(level
, name
int, arg
[4]byte) error
{
22 if err
:= fd
.incref(); err
!= nil {
26 return syscall
.SetsockoptInet4Addr(fd
.Sysfd
, level
, name
, arg
)
29 // SetsockoptLinger wraps the setsockopt network call with a Linger argument.
30 func (fd
*FD
) SetsockoptLinger(level
, name
int, l
*syscall
.Linger
) error
{
31 if err
:= fd
.incref(); err
!= nil {
35 return syscall
.SetsockoptLinger(fd
.Sysfd
, level
, name
, l
)