mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
* Chore: check Go modules before test & update dependencies * Chore: run go fmt to format code
22 lines
401 B
Go
22 lines
401 B
Go
//go:build linux && 386
|
|
// +build linux,386
|
|
|
|
package tproxy
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
const GETSOCKOPT = 15
|
|
|
|
func getsockopt(fd int, level int, optname int, optval unsafe.Pointer, optlen *uint32) (err error) {
|
|
_, _, e := syscall.Syscall6(
|
|
GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(optname),
|
|
uintptr(optval), uintptr(unsafe.Pointer(optlen)), 0)
|
|
if e != 0 {
|
|
return e
|
|
}
|
|
return
|
|
}
|