Node_Exporter/vendor/github.com/mdlayher/netlink/sockopt_linux.go

28 lines
414 B
Go
Raw Normal View History

// +build linux,!386
package netlink
import (
"unsafe"
2017-02-28 22:59:37 +01:00
"golang.org/x/sys/unix"
)
// setsockopt provides access to the setsockopt syscall.
func setsockopt(fd, level, name int, v unsafe.Pointer, l uint32) error {
2017-02-28 22:59:37 +01:00
_, _, errno := unix.Syscall6(
unix.SYS_SETSOCKOPT,
uintptr(fd),
uintptr(level),
uintptr(name),
uintptr(v),
uintptr(l),
0,
)
if errno != 0 {
return error(errno)
}
return nil
}