aerc/lib/keepalive_linux.go
Robin Jarry 15a4cc7d0a imap: fix build on macos
Fix the following build error on mac os:

 worker/imap/worker.go:368:29: undefined: syscall.TCP_KEEPCNT
 worker/imap/worker.go:376:29: undefined: syscall.TCP_KEEPINTVL

These symbols are not defined on darwin.

Fixes: 5dfeff75f3 ("imap: add tcp connection options")
Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-12-11 21:45:51 +01:00

17 lines
339 B
Go

//+build linux
package lib
import (
"syscall"
)
func SetTcpKeepaliveProbes(fd, count int) error {
return syscall.SetsockoptInt(
fd, syscall.IPPROTO_TCP, syscall.TCP_KEEPCNT, count)
}
func SetTcpKeepaliveInterval(fd, interval int) error {
return syscall.SetsockoptInt(
fd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, interval)
}