diff --git a/changelog/2769.added.md b/changelog/2769.added.md new file mode 100644 index 0000000000..94aff9d09a --- /dev/null +++ b/changelog/2769.added.md @@ -0,0 +1 @@ +Add `nix::sys::socket::sockopt:TcpCork` on Linux. diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 03a55d407c..5bc5ead46b 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -1315,6 +1315,16 @@ sockopt_impl!( libc::SO_ATTACH_REUSEPORT_CBPF, libc::sock_fprog ); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Enable/disable TCP corking. If enabled all queued partial frames are + /// sent when the option is cleared again. + TcpCork, + Both, + libc::IPPROTO_TCP, + libc::TCP_CORK, + bool +); #[allow(missing_docs)] // Not documented by Linux!