From 2e84b63ba7d8d0801344a432c1c22902d3bdaf9e Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Wed, 23 Jun 2021 16:36:47 +0200 Subject: [PATCH] Add TcpUserTimeout socket option --- CHANGELOG.md | 2 ++ src/sys/socket/sockopt.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7898d42d51..488a9e8492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1447](https://github.com/nix-rust/nix/pull/1447)) - Added `IpFreebind` socket option (sockopt) on Linux, Fuchsia and Android. (#[1456](https://github.com/nix-rust/nix/pull/1456)) +- Added `TcpUserTimeout` socket option (sockopt) on Linux and Fuchsia. + (#[1457](https://github.com/nix-rust/nix/pull/1457)) ### Changed ### Fixed diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index a9764f6f5b..3397a96622 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -261,6 +261,8 @@ sockopt_impl!(Both, TcpKeepIdle, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32); 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); +#[cfg(any(target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!(Both, TcpUserTimeout, libc::IPPROTO_TCP, libc::TCP_USER_TIMEOUT, u32); sockopt_impl!(Both, RcvBuf, libc::SOL_SOCKET, libc::SO_RCVBUF, usize); sockopt_impl!(Both, SndBuf, libc::SOL_SOCKET, libc::SO_SNDBUF, usize); #[cfg(any(target_os = "android", target_os = "linux"))]