Skip to content

Commit 5d2a8c2

Browse files
bors[bot]ltratt
andauthored
Merge #1318
1318: KEEPCNT/KEEPINTVL aren't available on OpenBSD. r=asomers a=ltratt 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. Co-authored-by: Laurence Tratt <[email protected]>
2 parents c51f63a + b0d1996 commit 5d2a8c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sys/socket/sockopt.rs

+2
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ sockopt_impl!(Both, TcpKeepAlive, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32);
252252
target_os = "linux",
253253
target_os = "nacl"))]
254254
sockopt_impl!(Both, TcpKeepIdle, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32);
255+
#[cfg(not(target_os = "openbsd"))]
255256
sockopt_impl!(Both, TcpKeepCount, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, u32);
257+
#[cfg(not(target_os = "openbsd"))]
256258
sockopt_impl!(Both, TcpKeepInterval, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32);
257259
sockopt_impl!(Both, RcvBuf, libc::SOL_SOCKET, libc::SO_RCVBUF, usize);
258260
sockopt_impl!(Both, SndBuf, libc::SOL_SOCKET, libc::SO_SNDBUF, usize);

0 commit comments

Comments
 (0)