summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorLaurence Tratt <laurie@tratt.net>2020-10-18 21:58:41 +0100
committerLaurence Tratt <laurie@tratt.net>2020-10-18 22:05:30 +0100
commitb0d19969112e2c5954fdc3ad644ce97a78f4c133 (patch)
tree74ea75808737e0fa41869a9da786ee6c1c5f168a /src/sys
parentc51f63a5f83a742b7b19870ccaa5a508dfe3367b (diff)
downloadnix-b0d19969112e2c5954fdc3ad644ce97a78f4c133.zip
KEEPCNT/KEEPINTVL aren't available on OpenBSD.
Without this commit, nix doesn't currently compile on OpenBSD. Some keepalive settings can be set globally, but not per-socket (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=970550 for some digging into this). Since it seems that NetBSD and DragonflyBSD have these settings, it makes more sense to only exclude them on OpenBSD rather than include them on (pretty much every) other operating systems.
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/socket/sockopt.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs
index e41a472a..5b7b4fea 100644
--- a/src/sys/socket/sockopt.rs
+++ b/src/sys/socket/sockopt.rs
@@ -252,7 +252,9 @@ sockopt_impl!(Both, TcpKeepAlive, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32);
target_os = "linux",
target_os = "nacl"))]
sockopt_impl!(Both, TcpKeepIdle, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32);
+#[cfg(not(target_os = "openbsd"))]
sockopt_impl!(Both, TcpKeepCount, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, u32);
+#[cfg(not(target_os = "openbsd"))]
sockopt_impl!(Both, TcpKeepInterval, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32);
sockopt_impl!(Both, RcvBuf, libc::SOL_SOCKET, libc::SO_RCVBUF, usize);
sockopt_impl!(Both, SndBuf, libc::SOL_SOCKET, libc::SO_SNDBUF, usize);