mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-20 15:36:07 +01:00
27 lines
405 B
Go
27 lines
405 B
Go
// +build linux,!386
|
|
|
|
package netlink
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
// setsockopt provides access to the setsockopt syscall.
|
|
func setsockopt(fd, level, name int, v unsafe.Pointer, l uint32) error {
|
|
_, _, errno := syscall.Syscall6(
|
|
syscall.SYS_SETSOCKOPT,
|
|
uintptr(fd),
|
|
uintptr(level),
|
|
uintptr(name),
|
|
uintptr(v),
|
|
uintptr(l),
|
|
0,
|
|
)
|
|
if errno != 0 {
|
|
return error(errno)
|
|
}
|
|
|
|
return nil
|
|
}
|