diff --git a/CHANGELOG.md b/CHANGELOG.md index b99255ca82..43da4107a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Added `MSG_WAITFORONE` to `MsgFlags` on Android, Fuchsia, Linux, NetBSD, FreeBSD, OpenBSD, and Solaris. ([#2014](https://github.com/nix-rust/nix/pull/2014)) +- Added `SO_TS_CLOCK` for FreeBSD to `nix::sys::socket::sockopt`. + ([#2093](https://github.com/nix-rust/nix/pull/2093)) ### Changed diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index ba380a86b3..44f3ebbc1d 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -711,6 +711,16 @@ sockopt_impl!( libc::SO_TIMESTAMPNS, bool ); +#[cfg(target_os = "freebsd")] +sockopt_impl!( + /// Sets a specific timestamp format instead of the classic `SCM_TIMESTAMP`, + /// to follow up after `SO_TIMESTAMP` is set. + TsClock, + Both, + libc::SOL_SOCKET, + libc::SO_TS_CLOCK, + i32 +); #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg(feature = "net")] sockopt_impl!(