github.com/ipfans/trojan-go@v0.11.0/tunnel/tproxy/getsockopt_i386.go (about) 1 //go:build linux && 386 2 // +build linux,386 3 4 package tproxy 5 6 import ( 7 "syscall" 8 "unsafe" 9 ) 10 11 const GETSOCKOPT = 15 12 13 func getsockopt(fd int, level int, optname int, optval unsafe.Pointer, optlen *uint32) (err error) { 14 _, _, e := syscall.Syscall6( 15 GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(optname), 16 uintptr(optval), uintptr(unsafe.Pointer(optlen)), 0) 17 if e != 0 { 18 return e 19 } 20 return 21 }