From 06ce5b72f799696ba9901bcc4e3f06bf7b7fbc56 Mon Sep 17 00:00:00 2001 From: Michael Baikov Date: Wed, 6 Oct 2021 12:22:39 +0800 Subject: [PATCH] code review --- CHANGELOG.md | 7 ++++++- src/sys/socket/mod.rs | 9 +++++---- test/sys/test_socket.rs | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccbb3562ec..f9f85f1aee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,14 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -## [0.23.0] - 2021-09-28 + +## [0.23.1] - 2021-10-06 ### Added +- Added the `SO_TIMESTAMPING` support + (#[1547](https://github.com/nix-rust/nix/pull/1547)) +## [0.23.0] - 2021-09-28 +### Added - Added the `LocalPeerCred` sockopt. (#[1482](https://github.com/nix-rust/nix/pull/1482)) - Added `TimeSpec::from_duration` and `TimeSpec::from_timespec` diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index a6581b2769..df23a89af5 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -171,7 +171,11 @@ pub enum SockProtocol { } #[cfg(any(target_os = "linux"))] -libc_bitflags!{ +libc_bitflags! { + /// Configuration flags for `SO_TIMESTAMPING` interface + /// + /// For use with [`Timestamping`][sockopt::Timestamping]. + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) pub struct TimestampingFlag: c_uint { /// Report any software timestamps when available. SOF_TIMESTAMPING_SOFTWARE; @@ -614,9 +618,6 @@ pub enum ControlMessageOwned { /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) #[cfg(all(target_os = "linux"))] ScmTimestampsns(Timestamps), - #[cfg(any( - target_os = "linux", - ))] /// Nanoseconds resolution timestamp /// /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 8f7b0e6790..7a861abfdd 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -58,7 +58,7 @@ pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { } #[cfg(any(target_os = "linux"))] -#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +#[cfg_attr(qemu, ignore)] #[test] pub fn test_timestamping() { use nix::sys::socket::{