hysteria/app/internal/sockopts/timeval_linux_64.go
HystericalDragon 9520d84094
fix: timeval in different arch
Signed-off-by: HystericalDragon <HystericalDragons@proton.me>
2024-04-05 09:57:45 +08:00

15 lines
335 B
Go

//go:build linux && (amd64 || arm64 || loong64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x || sparc64)
package sockopts
import (
"golang.org/x/sys/unix"
)
func unixTimeval() unix.Timeval {
timeUsec := fdControlUnixTimeout.Microseconds()
return unix.Timeval{
Sec: timeUsec / 1e6,
Usec: timeUsec % 1e6,
}
}