diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 84d8d1a1f436a..86467f799f0f2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,6 +99,12 @@ jobs: artifact-tag: offset-bits64 env: RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 + - target: i686-unknown-linux-gnu + docker: true + os: ubuntu-24.04 + artifact-tag: time-bits64 + env: + RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 - target: x86_64-unknown-linux-gnu docker: true os: ubuntu-24.04 @@ -172,7 +178,8 @@ jobs: - aarch64-unknown-linux-musl - arm-linux-androideabi - arm-unknown-linux-musleabihf - - i686-linux-android + # FIXME(#4297): Disabled due to spurious failueSome android jobs are disabled because of high rates of + # - i686-linux-android - i686-unknown-linux-musl - loongarch64-unknown-linux-gnu - loongarch64-unknown-linux-musl @@ -196,6 +203,10 @@ jobs: env: RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 artifact-tag: offset-bits64 + - target: arm-unknown-linux-gnueabihf + env: + RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 + artifact-tag: time-bits64 - target: aarch64-unknown-linux-musl env: RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 @@ -215,6 +226,10 @@ jobs: # env: # RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 # artifact-tag: offset-bits64 + # - target: powerpc-unknown-linux-gnu + # env: + # RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 + # artifact-tag: time-bits64 timeout-minutes: 25 env: TARGET: ${{ matrix.target }} @@ -260,7 +275,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: test on Solaris - uses: vmactions/solaris-vm@v1.1.3 + uses: vmactions/solaris-vm@v1.1.4 with: release: "11.4-gcc" usesh: true diff --git a/Cargo.toml b/Cargo.toml index 0f6a6a7e54b88..8ea9997cb7661 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,7 @@ targets = [ "powerpc-unknown-netbsd", "powerpc-wrs-vxworks", "powerpc-wrs-vxworks-spe", + "powerpc64-ibm-aix", "powerpc64-unknown-freebsd", "powerpc64-unknown-linux-gnu", "powerpc64-wrs-vxworks", @@ -148,6 +149,7 @@ use_std = ['std'] [workspace] members = [ "ctest", + "ctest-next", "libc-test", ] diff --git a/build.rs b/build.rs index 6eafad5429b9b..5e1e62c5188ef 100644 --- a/build.rs +++ b/build.rs @@ -15,6 +15,8 @@ const ALLOWED_CFGS: &[&str] = &[ "freebsd15", // Corresponds to `_FILE_OFFSET_BITS=64` in glibc "gnu_file_offset_bits64", + // Corresponds to `_TIME_BITS=64` in glibc + "gnu_time_bits64", // FIXME(ctest): this config shouldn't be needed but ctest can't parse `const extern fn` "libc_const_extern_fn", "libc_deny_warnings", @@ -103,23 +105,35 @@ fn main() { set_cfg("linux_time_bits64"); } println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS"); - match env::var("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS") { - Ok(val) if val == "64" => { - if target_env == "gnu" - && target_os == "linux" - && target_ptr_width == "32" - && target_arch != "riscv32" - && target_arch != "x86_64" - { + println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_TIME_BITS"); + if target_env == "gnu" + && target_os == "linux" + && target_ptr_width == "32" + && target_arch != "riscv32" + && target_arch != "x86_64" + { + match env::var("RUST_LIBC_UNSTABLE_GNU_TIME_BITS") { + Ok(val) if val == "64" => { set_cfg("gnu_file_offset_bits64"); + set_cfg("linux_time_bits64"); + set_cfg("gnu_time_bits64"); + } + Ok(val) if val != "32" => { + panic!("RUST_LIBC_UNSTABLE_GNU_TIME_BITS may only be set to '32' or '64'") + } + _ => { + match env::var("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS") { + Ok(val) if val == "64" => { + set_cfg("gnu_file_offset_bits64"); + } + Ok(val) if val != "32" => { + panic!("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS may only be set to '32' or '64'") + } + _ => {} + } } } - Ok(val) if val != "32" => { - panic!("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS may only be set to '32' or '64'") - } - _ => {} } - // On CI: deny all warnings if libc_ci { set_cfg("libc_deny_warnings"); diff --git a/ci/run-docker.sh b/ci/run-docker.sh index 6e18e520ce2d1..9411d39e5f670 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -44,6 +44,7 @@ run() { --env LIBC_CI \ --env LIBC_CI_ZBUILD_STD \ --env RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS \ + --env RUST_LIBC_UNSTABLE_GNU_TIME_BITS \ --env CARGO_HOME=/cargo \ --env CARGO_TARGET_DIR=/checkout/target \ --volume "$CARGO_HOME":/cargo \ diff --git a/ci/verify-build.sh b/ci/verify-build.sh index 375a5de1b0a2f..7def289221491 100755 --- a/ci/verify-build.sh +++ b/ci/verify-build.sh @@ -76,9 +76,12 @@ test_target() { # Test with the equivalent of __USE_TIME_BITS64 RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd case "$target" in - # Test with the equivalent of __FILE_OFFSET_BITS=64 arm*-gnu*|i*86*-gnu|powerpc-*-gnu*|mips*-gnu|sparc-*-gnu|thumb-*gnu*) - RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS=64 $cmd;; + # Test with the equivalent of _FILE_OFFSET_BITS=64 + RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS=64 $cmd + # Test with the equivalent of _TIME_BITS=64 + RUST_LIBC_UNSTABLE_GNU_TIME_BITS=64 $cmd + ;; esac fi diff --git a/ctest-next/Cargo.toml b/ctest-next/Cargo.toml new file mode 100644 index 0000000000000..b30a6b30eab76 --- /dev/null +++ b/ctest-next/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "ctest-next" +version = "0.1.0" +edition = "2021" +rust-version = "1.77" +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang/libc" +publish = false diff --git a/ctest-next/src/lib.rs b/ctest-next/src/lib.rs new file mode 100644 index 0000000000000..7d12d9af8195b --- /dev/null +++ b/ctest-next/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/libc-test/build.rs b/libc-test/build.rs index 4815715a5c493..c6282de1a3a5c 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -622,9 +622,12 @@ fn test_openbsd(target: &str) { "KERN_MAXID" | "NET_RT_MAXID" => true, "EV_SYSFLAGS" => true, - // Removed in OpenBSD 7.7 (unused since 1991) + // Removed in OpenBSD 7.7 "ATF_COM" | "ATF_PERM" | "ATF_PUBL" | "ATF_USETRAILERS" => true, + // Removed in OpenBSD 7.8 + "CTL_FS" | "SO_NETPROC" => true, + _ => false, } }); @@ -3689,22 +3692,37 @@ fn test_vxworks(target: &str) { } fn config_gnu_bits(target: &str, cfg: &mut ctest::TestGenerator) { - match env::var("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS") { - Ok(val) if val == "64" => { - if target.contains("gnu") - && target.contains("linux") - && !target.ends_with("x32") - && !target.contains("riscv32") - && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32" - { + let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap_or_default(); + if target.contains("gnu") + && target.contains("linux") + && !target.ends_with("x32") + && !target.contains("riscv32") + && pointer_width == "32" + { + match env::var("RUST_LIBC_UNSTABLE_GNU_TIME_BITS") { + Ok(val) if val == "64" => { cfg.define("_FILE_OFFSET_BITS", Some("64")); + cfg.define("_TIME_BITS", Some("64")); cfg.cfg("gnu_file_offset_bits64", None); + cfg.cfg("linux_time_bits64", None); + cfg.cfg("gnu_time_bits64", None); + } + Ok(val) if val != "32" => { + panic!("RUST_LIBC_UNSTABLE_GNU_TIME_BITS may only be set to '32' or '64'") + } + _ => { + match env::var("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS") { + Ok(val) if val == "64" => { + cfg.define("_FILE_OFFSET_BITS", Some("64")); + cfg.cfg("gnu_file_offset_bits64", None); + } + Ok(val) if val != "32" => { + panic!("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS may only be set to '32' or '64'") + } + _ => {} + } } } - Ok(val) if val != "32" => { - panic!("RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS may only be set to '32' or '64'") - } - _ => {} } } @@ -5607,9 +5625,9 @@ fn test_aix(target: &str) { }); cfg.type_name(move |ty, is_struct, is_union| match ty { - "DIR" => ty.to_string(), - "FILE" => ty.to_string(), - "ACTION" => ty.to_string(), + "DIR" => ty.to_string(), + "FILE" => ty.to_string(), + "ACTION" => ty.to_string(), // 'sigval' is a struct in Rust, but a union in C. "sigval" => format!("union sigval"), @@ -5696,9 +5714,9 @@ fn test_aix(target: &str) { // POSIX-compliant versions in the system libc. As a result, // function pointer comparisons between the C and Rust sides // would fail. - "getpwuid_r" | "getpwnam_r" | "getgrgid_r" | "getgrnam_r" - | "aio_cancel" | "aio_error" | "aio_fsync" | "aio_read" - | "aio_return" | "aio_suspend" | "aio_write" | "select" => true, + "getpwuid_r" | "getpwnam_r" | "getgrgid_r" | "getgrnam_r" | "aio_cancel" + | "aio_error" | "aio_fsync" | "aio_read" | "aio_return" | "aio_suspend" + | "aio_write" | "select" => true, // 'getdtablesize' is a constant in the AIX header but it is // a real function in libc which the Rust side is resolved to. @@ -5715,7 +5733,6 @@ fn test_aix(target: &str) { } }); - cfg.volatile_item(|i| { use ctest::VolatileItemKind::*; match i { diff --git a/libc-test/test/cmsg.rs b/libc-test/test/cmsg.rs index 15f4fed1e30ec..763819019b771 100644 --- a/libc-test/test/cmsg.rs +++ b/libc-test/test/cmsg.rs @@ -70,7 +70,7 @@ mod t { for cmsg_len in 0..64 { // Address must be a multiple of 0x4 for testing on AIX. if cfg!(target_os = "aix") && cmsg_len % std::mem::size_of::() != 0 { - continue; + continue; } for next_cmsg_len in 0..32 { unsafe { diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index c09708f71a0f6..bfd71ff78dda7 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -1068,26 +1068,6 @@ cfg_if! { } } impl Eq for sysinfo {} - impl fmt::Debug for sysinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sysinfo") - .field("uptime", &self.uptime) - .field("loads", &self.loads) - .field("totalram", &self.totalram) - .field("freeram", &self.freeram) - .field("sharedram", &self.sharedram) - .field("bufferram", &self.bufferram) - .field("totalswap", &self.totalswap) - .field("freeswap", &self.freeswap) - .field("procs", &self.procs) - .field("pad", &self.pad) - .field("totalhigh", &self.totalhigh) - .field("freehigh", &self.freehigh) - .field("mem_unit", &self.mem_unit) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } impl hash::Hash for sysinfo { fn hash(&self, state: &mut H) { self.uptime.hash(state); @@ -1118,14 +1098,6 @@ cfg_if! { } } impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_family.hash(state); @@ -1145,15 +1117,6 @@ cfg_if! { } } impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_family", &self.ss_family) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_family.hash(state); @@ -1191,17 +1154,6 @@ cfg_if! { } } impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - .finish() - } - } impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); @@ -1226,17 +1178,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -1261,17 +1202,6 @@ cfg_if! { } } impl Eq for dirent64 {} - impl fmt::Debug for dirent64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent64") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent64 { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -1291,16 +1221,6 @@ cfg_if! { } } impl Eq for mq_attr {} - impl fmt::Debug for mq_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mq_attr") - .field("mq_flags", &self.mq_flags) - .field("mq_maxmsg", &self.mq_maxmsg) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_curmsgs", &self.mq_curmsgs) - .finish() - } - } impl hash::Hash for mq_attr { fn hash(&self, state: &mut H) { self.mq_flags.hash(state); @@ -1318,15 +1238,6 @@ cfg_if! { } } impl Eq for sockaddr_nl {} - impl fmt::Debug for sockaddr_nl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_nl") - .field("nl_family", &self.nl_family) - .field("nl_pid", &self.nl_pid) - .field("nl_groups", &self.nl_groups) - .finish() - } - } impl hash::Hash for sockaddr_nl { fn hash(&self, state: &mut H) { self.nl_family.hash(state); @@ -1347,17 +1258,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_value", &self.sigev_value) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_notify", &self.sigev_notify) - .field("sigev_notify_function", &self.sigev_notify_function) - .field("sigev_notify_attributes", &self.sigev_notify_attributes) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_value.hash(state); @@ -1374,13 +1274,6 @@ cfg_if! { } } impl Eq for pthread_cond_t {} - impl fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_cond_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } impl hash::Hash for pthread_cond_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -1393,13 +1286,6 @@ cfg_if! { } } impl Eq for pthread_mutex_t {} - impl fmt::Debug for pthread_mutex_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_mutex_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } impl hash::Hash for pthread_mutex_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -1412,13 +1298,6 @@ cfg_if! { } } impl Eq for pthread_rwlock_t {} - impl fmt::Debug for pthread_rwlock_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_rwlock_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } impl hash::Hash for pthread_rwlock_t { fn hash(&self, state: &mut H) { self.size.hash(state); diff --git a/src/fuchsia/x86_64.rs b/src/fuchsia/x86_64.rs index a184539e28277..add60a4564020 100644 --- a/src/fuchsia/x86_64.rs +++ b/src/fuchsia/x86_64.rs @@ -94,18 +94,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - // FIXME(debug): .field("__private", &self.__private) - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/lib.rs b/src/lib.rs index 50aed357a82ab..a96ffc6ffe8ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,15 +7,8 @@ bad_style, overflowing_literals, improper_ctypes, - // This lint is renamed but we run CI for old stable rustc so should be here. - redundant_semicolon, - redundant_semicolons, unused_macros, unused_macro_rules, - // FIXME(1.0): temporarily allow dead_code to fix CI: - // - https://github.com/rust-lang/libc/issues/3740 - // - https://github.com/rust-lang/rust/pull/126456 - dead_code, )] #![cfg_attr(libc_deny_warnings, deny(warnings))] // Attributes needed when building as part of the standard library @@ -25,8 +18,8 @@ // DIFF(1.0): The thread local references that raise this lint were removed in 1.0 #![cfg_attr(feature = "rustc-dep-of-std", allow(static_mut_refs))] // Enable extra lints: -#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))] -#![deny(missing_copy_implementations, safe_packed_borrows)] +#![cfg_attr(feature = "extra_traits", warn(missing_debug_implementations))] +#![warn(missing_copy_implementations, safe_packed_borrows)] #![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] #![cfg_attr(feature = "rustc-dep-of-std", no_core)] diff --git a/src/macros.rs b/src/macros.rs index abffa2afb9520..a0fb7ff12c0f8 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -141,7 +141,8 @@ macro_rules! s_paren { )*); } -/// Implement `Clone` and `Copy` for a struct with no `extra_traits` feature. +/// Implement `Clone` and `Copy` for a struct with no `extra_traits` feature, as well as `Debug` +/// with `extra_traits` since that can always be derived. /// /// Most items will prefer to use [`s`]. macro_rules! s_no_extra_traits { @@ -172,6 +173,7 @@ macro_rules! s_no_extra_traits { __item! { #[repr(C)] #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] + #[cfg_attr(feature = "extra_traits", ::core::prelude::v1::derive(Debug))] $(#[$attr])* pub struct $i { $($field)* } } diff --git a/src/psp.rs b/src/psp.rs index 73d4ae0173ece..56d528cff54c2 100644 --- a/src/psp.rs +++ b/src/psp.rs @@ -2115,12 +2115,10 @@ s! { } s_no_extra_traits! { - #[allow(missing_debug_implementations)] pub struct GeContext { pub context: [u32; 512], } - #[allow(missing_debug_implementations)] pub struct SceKernelUtilsSha1Context { pub h: [u32; 5usize], pub us_remains: u16, @@ -2129,13 +2127,11 @@ s_no_extra_traits! { pub buf: [u8; 64usize], } - #[allow(missing_debug_implementations)] pub struct SceKernelUtilsMt19937Context { pub count: u32, pub state: [u32; 624usize], } - #[allow(missing_debug_implementations)] pub struct SceKernelUtilsMd5Context { pub h: [u32; 4usize], pub pad: u32, @@ -2145,7 +2141,6 @@ s_no_extra_traits! { pub buf: [u8; 64usize], } - #[allow(missing_debug_implementations)] pub struct SceIoDirent { pub d_stat: SceIoStat, pub d_name: [u8; 256usize], @@ -2153,7 +2148,6 @@ s_no_extra_traits! { pub dummy: i32, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFRect { pub x: f32, pub y: f32, @@ -2162,7 +2156,6 @@ s_no_extra_traits! { } #[repr(align(16))] - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFVector3 { pub x: f32, pub y: f32, @@ -2170,7 +2163,6 @@ s_no_extra_traits! { } #[repr(align(16))] - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFVector4 { pub x: f32, pub y: f32, @@ -2178,7 +2170,6 @@ s_no_extra_traits! { pub w: f32, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFVector4Unaligned { pub x: f32, pub y: f32, @@ -2186,26 +2177,22 @@ s_no_extra_traits! { pub w: f32, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFVector2 { pub x: f32, pub y: f32, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFMatrix2 { pub x: ScePspFVector2, pub y: ScePspFVector2, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub struct ScePspFMatrix3 { pub x: ScePspFVector3, pub y: ScePspFVector3, pub z: ScePspFVector3, } - #[cfg_attr(feature = "extra_traits", derive(Debug))] #[repr(align(16))] pub struct ScePspFMatrix4 { pub x: ScePspFVector4, @@ -2214,7 +2201,6 @@ s_no_extra_traits! { pub w: ScePspFVector4, } - #[allow(missing_debug_implementations)] pub struct ScePspFMatrix4Unaligned { pub x: ScePspFVector4, pub y: ScePspFVector4, @@ -2222,7 +2208,6 @@ s_no_extra_traits! { pub w: ScePspFVector4, } - #[allow(missing_debug_implementations)] pub union ScePspVector3 { pub fv: ScePspFVector3, pub iv: ScePspIVector3, @@ -2230,7 +2215,6 @@ s_no_extra_traits! { pub i: [i32; 3usize], } - #[allow(missing_debug_implementations)] pub union ScePspVector4 { pub fv: ScePspFVector4, pub iv: ScePspIVector4, @@ -2239,7 +2223,6 @@ s_no_extra_traits! { pub i: [i32; 4usize], } - #[allow(missing_debug_implementations)] pub union ScePspMatrix2 { pub fm: ScePspFMatrix2, pub im: ScePspIMatrix2, @@ -2250,7 +2233,6 @@ s_no_extra_traits! { pub i: [[i32; 2usize]; 2usize], } - #[allow(missing_debug_implementations)] pub union ScePspMatrix3 { pub fm: ScePspFMatrix3, pub im: ScePspIMatrix3, @@ -2261,7 +2243,6 @@ s_no_extra_traits! { pub i: [[i32; 3usize]; 3usize], } - #[allow(missing_debug_implementations)] pub union ScePspVector2 { pub fv: ScePspFVector2, pub iv: ScePspIVector2, @@ -2269,7 +2250,6 @@ s_no_extra_traits! { pub i: [i32; 2usize], } - #[allow(missing_debug_implementations)] pub union ScePspMatrix4 { pub fm: ScePspFMatrix4, pub im: ScePspIMatrix4, @@ -2280,7 +2260,6 @@ s_no_extra_traits! { pub i: [[i32; 4usize]; 4usize], } - #[allow(missing_debug_implementations)] pub struct Key { pub key_type: KeyType, pub name: [u8; 256usize], @@ -2289,7 +2268,6 @@ s_no_extra_traits! { pub unk3: u32, } - #[allow(missing_debug_implementations)] pub struct UtilityMsgDialogParams { pub base: UtilityDialogCommon, pub unknown: i32, @@ -2300,13 +2278,11 @@ s_no_extra_traits! { pub button_pressed: UtilityMsgDialogPressed, } - #[allow(missing_debug_implementations)] pub union UtilityNetData { pub as_uint: u32, pub as_string: [u8; 128usize], } - #[allow(missing_debug_implementations)] pub struct UtilitySavedataSFOParam { pub title: [u8; 128usize], pub savedata_title: [u8; 128usize], @@ -2315,7 +2291,6 @@ s_no_extra_traits! { pub unknown: [u8; 3usize], } - #[allow(missing_debug_implementations)] pub struct SceUtilitySavedataParam { pub base: UtilityDialogCommon, pub mode: UtilitySavedataMode, @@ -2342,7 +2317,6 @@ s_no_extra_traits! { pub unknown3: [u8; 20], } - #[allow(missing_debug_implementations)] pub struct SceNetAdhocctlPeerInfo { pub next: *mut SceNetAdhocctlPeerInfo, pub nickname: [u8; 128usize], @@ -2351,7 +2325,6 @@ s_no_extra_traits! { pub timestamp: u32, } - #[allow(missing_debug_implementations)] pub struct SceNetAdhocctlParams { pub channel: i32, pub name: [u8; 8usize], @@ -2359,7 +2332,6 @@ s_no_extra_traits! { pub nickname: [u8; 128usize], } - #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] pub union SceNetApctlInfo { pub name: [u8; 64usize], pub bssid: [u8; 6usize], diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index f06d475565cfd..3f8145d6b3b42 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -581,18 +581,6 @@ cfg_if! { } } impl Eq for poll_ctl_ext {} - impl fmt::Debug for poll_ctl_ext { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("poll_ctl_ext") - .field("version", &self.version) - .field("command", &self.command) - .field("events", &self.events) - .field("fd", &self.fd) - .field("u", &self.u) - .field("reserved64", &self.reserved64) - .finish() - } - } impl hash::Hash for poll_ctl_ext { fn hash(&self, state: &mut H) { self.version.hash(state); diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs index 1bc177841afcd..f379e2df71898 100644 --- a/src/unix/aix/powerpc64.rs +++ b/src/unix/aix/powerpc64.rs @@ -313,22 +313,6 @@ cfg_if! { } } impl Eq for siginfo_t {} - impl fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("siginfo_t") - .field("si_signo", &self.si_signo) - .field("si_errno", &self.si_errno) - .field("si_code", &self.si_code) - .field("si_pid", &self.si_pid) - .field("si_uid", &self.si_uid) - .field("si_status", &self.si_status) - .field("si_addr", &self.si_addr) - .field("si_band", &self.si_band) - .field("si_value", &self.si_value) - .field("__si_flags", &self.__si_flags) - .finish() - } - } impl hash::Hash for siginfo_t { fn hash(&self, state: &mut H) { self.si_signo.hash(state); @@ -372,16 +356,6 @@ cfg_if! { } } impl Eq for pollfd_ext {} - impl fmt::Debug for pollfd_ext { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("pollfd_ext") - .field("fd", &self.fd) - .field("events", &self.events) - .field("revents", &self.revents) - .field("data", &self.data) - .finish() - } - } impl hash::Hash for pollfd_ext { fn hash(&self, state: &mut H) { self.fd.hash(state); @@ -398,12 +372,6 @@ cfg_if! { impl Eq for fpreg_t {} - impl fmt::Debug for fpreg_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpreg_t").field("d", &self.d).finish() - } - } - impl hash::Hash for fpreg_t { fn hash(&self, state: &mut H) { let d: u64 = unsafe { mem::transmute(self.d) }; diff --git a/src/unix/bsd/apple/b32/mod.rs b/src/unix/bsd/apple/b32/mod.rs index 3753ffb085907..bdc986da168a8 100644 --- a/src/unix/bsd/apple/b32/mod.rs +++ b/src/unix/bsd/apple/b32/mod.rs @@ -80,14 +80,6 @@ cfg_if! { } } impl Eq for pthread_attr_t {} - impl fmt::Debug for pthread_attr_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_attr_t") - .field("__sig", &self.__sig) - // FIXME(debug): .field("__opaque", &self.__opaque) - .finish() - } - } impl hash::Hash for pthread_attr_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); @@ -105,13 +97,6 @@ cfg_if! { } } impl Eq for pthread_once_t {} - impl fmt::Debug for pthread_once_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_once_t") - .field("__sig", &self.__sig) - .finish() - } - } impl hash::Hash for pthread_once_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); diff --git a/src/unix/bsd/apple/b64/mod.rs b/src/unix/bsd/apple/b64/mod.rs index 2bd682313428e..34743464a44e7 100644 --- a/src/unix/bsd/apple/b64/mod.rs +++ b/src/unix/bsd/apple/b64/mod.rs @@ -73,14 +73,6 @@ cfg_if! { } } impl Eq for pthread_attr_t {} - impl fmt::Debug for pthread_attr_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_attr_t") - .field("__sig", &self.__sig) - // FIXME(debug): .field("__opaque", &self.__opaque) - .finish() - } - } impl hash::Hash for pthread_attr_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); @@ -98,13 +90,6 @@ cfg_if! { } } impl Eq for pthread_once_t {} - impl fmt::Debug for pthread_once_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_once_t") - .field("__sig", &self.__sig) - .finish() - } - } impl hash::Hash for pthread_once_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index ebc841a99c36e..14b35e200ec39 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1753,11 +1753,6 @@ cfg_if! { } } impl Eq for ifconf {} - impl fmt::Debug for ifconf { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifconf").finish_non_exhaustive() - } - } impl PartialEq for kevent { fn eq(&self, other: &kevent) -> bool { @@ -1770,24 +1765,6 @@ cfg_if! { } } impl Eq for kevent {} - impl fmt::Debug for kevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ident = self.ident; - let filter = self.filter; - let flags = self.flags; - let fflags = self.fflags; - let data = self.data; - let udata = self.udata; - f.debug_struct("kevent") - .field("ident", &ident) - .field("filter", &filter) - .field("flags", &flags) - .field("fflags", &fflags) - .field("data", &data) - .field("udata", &udata) - .finish() - } - } impl hash::Hash for kevent { fn hash(&self, state: &mut H) { let ident = self.ident; @@ -1822,28 +1799,6 @@ cfg_if! { } } impl Eq for semid_ds {} - impl fmt::Debug for semid_ds { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let sem_perm = self.sem_perm; - let sem_base = self.sem_base; - let sem_nsems = self.sem_nsems; - let sem_otime = self.sem_otime; - let sem_pad1 = self.sem_pad1; - let sem_ctime = self.sem_ctime; - let sem_pad2 = self.sem_pad2; - let sem_pad3 = self.sem_pad3; - f.debug_struct("semid_ds") - .field("sem_perm", &sem_perm) - .field("sem_base", &sem_base) - .field("sem_nsems", &sem_nsems) - .field("sem_otime", &sem_otime) - .field("sem_pad1", &sem_pad1) - .field("sem_ctime", &sem_ctime) - .field("sem_pad2", &sem_pad2) - .field("sem_pad3", &sem_pad3) - .finish() - } - } impl hash::Hash for semid_ds { fn hash(&self, state: &mut H) { let sem_perm = self.sem_perm; @@ -1881,30 +1836,6 @@ cfg_if! { } } impl Eq for shmid_ds {} - impl fmt::Debug for shmid_ds { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let shm_perm = self.shm_perm; - let shm_segsz = self.shm_segsz; - let shm_lpid = self.shm_lpid; - let shm_cpid = self.shm_cpid; - let shm_nattch = self.shm_nattch; - let shm_atime = self.shm_atime; - let shm_dtime = self.shm_dtime; - let shm_ctime = self.shm_ctime; - let shm_internal = self.shm_internal; - f.debug_struct("shmid_ds") - .field("shm_perm", &shm_perm) - .field("shm_segsz", &shm_segsz) - .field("shm_lpid", &shm_lpid) - .field("shm_cpid", &shm_cpid) - .field("shm_nattch", &shm_nattch) - .field("shm_atime", &shm_atime) - .field("shm_dtime", &shm_dtime) - .field("shm_ctime", &shm_ctime) - .field("shm_internal", &shm_internal) - .finish() - } - } impl hash::Hash for shmid_ds { fn hash(&self, state: &mut H) { let shm_perm = self.shm_perm; @@ -1948,23 +1879,6 @@ cfg_if! { } } impl Eq for proc_threadinfo {} - impl fmt::Debug for proc_threadinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("proc_threadinfo") - .field("pth_user_time", &self.pth_user_time) - .field("pth_system_time", &self.pth_system_time) - .field("pth_cpu_usage", &self.pth_cpu_usage) - .field("pth_policy", &self.pth_policy) - .field("pth_run_state", &self.pth_run_state) - .field("pth_flags", &self.pth_flags) - .field("pth_sleep_time", &self.pth_sleep_time) - .field("pth_curpri", &self.pth_curpri) - .field("pth_priority", &self.pth_priority) - .field("pth_maxpriority", &self.pth_maxpriority) - // FIXME(debug): .field("pth_name", &self.pth_name) - .finish() - } - } impl hash::Hash for proc_threadinfo { fn hash(&self, state: &mut H) { self.pth_user_time.hash(state); @@ -2011,28 +1925,6 @@ cfg_if! { } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_fsid", &self.f_fsid) - .field("f_owner", &self.f_owner) - .field("f_flags", &self.f_flags) - .field("f_fssubtype", &self.f_fssubtype) - .field("f_fstypename", &self.f_fstypename) - .field("f_type", &self.f_type) - // FIXME(debug): .field("f_mntonname", &self.f_mntonname) - // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) - .field("f_reserved", &self.f_reserved) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { @@ -2070,18 +1962,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_seekoff", &self.d_seekoff) - .field("d_reclen", &self.d_reclen) - .field("d_namlen", &self.d_namlen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -2103,14 +1983,6 @@ cfg_if! { } } impl Eq for pthread_rwlock_t {} - impl fmt::Debug for pthread_rwlock_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_rwlock_t") - .field("__sig", &self.__sig) - // FIXME(debug): .field("__opaque", &self.__opaque) - .finish() - } - } impl hash::Hash for pthread_rwlock_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); @@ -2131,15 +2003,6 @@ cfg_if! { impl Eq for pthread_mutex_t {} - impl fmt::Debug for pthread_mutex_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_mutex_t") - .field("__sig", &self.__sig) - // FIXME(debug): .field("__opaque", &self.__opaque) - .finish() - } - } - impl hash::Hash for pthread_mutex_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); @@ -2160,15 +2023,6 @@ cfg_if! { impl Eq for pthread_cond_t {} - impl fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_cond_t") - .field("__sig", &self.__sig) - // FIXME(debug): .field("__opaque", &self.__opaque) - .finish() - } - } - impl hash::Hash for pthread_cond_t { fn hash(&self, state: &mut H) { self.__sig.hash(state); @@ -2196,18 +2050,6 @@ cfg_if! { impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } - impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); @@ -2240,21 +2082,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - // FIXME(debug): .field("ut_user", &self.ut_user) - .field("ut_id", &self.ut_id) - .field("ut_line", &self.ut_line) - .field("ut_pid", &self.ut_pid) - .field("ut_type", &self.ut_type) - .field("ut_tv", &self.ut_tv) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_pad", &self.ut_pad) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_user.hash(state); @@ -2279,17 +2106,6 @@ cfg_if! { impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("sigev_notify_attributes", &self.sigev_notify_attributes) - .finish() - } - } - impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); @@ -2305,13 +2121,6 @@ cfg_if! { } } impl Eq for processor_cpu_load_info {} - impl fmt::Debug for processor_cpu_load_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("processor_cpu_load_info") - .field("cpu_ticks", &self.cpu_ticks) - .finish() - } - } impl hash::Hash for processor_cpu_load_info { fn hash(&self, state: &mut H) { self.cpu_ticks.hash(state); @@ -2328,17 +2137,6 @@ cfg_if! { } } impl Eq for processor_basic_info {} - impl fmt::Debug for processor_basic_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("processor_basic_info") - .field("cpu_type", &self.cpu_type) - .field("cpu_subtype", &self.cpu_subtype) - .field("running", &self.running) - .field("slot_num", &self.slot_num) - .field("is_master", &self.is_master) - .finish() - } - } impl hash::Hash for processor_basic_info { fn hash(&self, state: &mut H) { self.cpu_type.hash(state); @@ -2356,14 +2154,6 @@ cfg_if! { } } impl Eq for processor_set_basic_info {} - impl fmt::Debug for processor_set_basic_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("processor_set_basic_info") - .field("processor_count", &self.processor_count) - .field("default_policy", &self.default_policy) - .finish() - } - } impl hash::Hash for processor_set_basic_info { fn hash(&self, state: &mut H) { self.processor_count.hash(state); @@ -2380,16 +2170,6 @@ cfg_if! { } } impl Eq for processor_set_load_info {} - impl fmt::Debug for processor_set_load_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("processor_set_load_info") - .field("task_count", &self.task_count) - .field("thread_count", &self.thread_count) - .field("load_average", &self.load_average) - .field("mach_factor", &self.mach_factor) - .finish() - } - } impl hash::Hash for processor_set_load_info { fn hash(&self, state: &mut H) { self.task_count.hash(state); @@ -2405,14 +2185,6 @@ cfg_if! { } } impl Eq for time_value_t {} - impl fmt::Debug for time_value_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("time_value_t") - .field("seconds", &self.seconds) - .field("microseconds", &self.microseconds) - .finish() - } - } impl hash::Hash for time_value_t { fn hash(&self, state: &mut H) { self.seconds.hash(state); @@ -2432,20 +2204,6 @@ cfg_if! { } } impl Eq for thread_basic_info {} - impl fmt::Debug for thread_basic_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("thread_basic_info") - .field("user_time", &self.user_time) - .field("system_time", &self.system_time) - .field("cpu_usage", &self.cpu_usage) - .field("policy", &self.policy) - .field("run_state", &self.run_state) - .field("flags", &self.flags) - .field("suspend_count", &self.suspend_count) - .field("sleep_time", &self.sleep_time) - .finish() - } - } impl hash::Hash for thread_basic_info { fn hash(&self, state: &mut H) { self.user_time.hash(state); @@ -2478,23 +2236,6 @@ cfg_if! { } } impl Eq for thread_extended_info {} - impl fmt::Debug for thread_extended_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("proc_threadinfo") - .field("pth_user_time", &self.pth_user_time) - .field("pth_system_time", &self.pth_system_time) - .field("pth_cpu_usage", &self.pth_cpu_usage) - .field("pth_policy", &self.pth_policy) - .field("pth_run_state", &self.pth_run_state) - .field("pth_flags", &self.pth_flags) - .field("pth_sleep_time", &self.pth_sleep_time) - .field("pth_curpri", &self.pth_curpri) - .field("pth_priority", &self.pth_priority) - .field("pth_maxpriority", &self.pth_maxpriority) - // FIXME(debug): .field("pth_name", &self.pth_name) - .finish() - } - } impl hash::Hash for thread_extended_info { fn hash(&self, state: &mut H) { self.pth_user_time.hash(state); @@ -2518,15 +2259,6 @@ cfg_if! { } } impl Eq for thread_identifier_info {} - impl fmt::Debug for thread_identifier_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("thread_identifier_info") - .field("thread_id", &self.thread_id) - .field("thread_handle", &self.thread_handle) - .field("dispatch_qaddr", &self.dispatch_qaddr) - .finish() - } - } impl hash::Hash for thread_identifier_info { fn hash(&self, state: &mut H) { self.thread_id.hash(state); @@ -2564,62 +2296,6 @@ cfg_if! { } } impl Eq for if_data64 {} - impl fmt::Debug for if_data64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ifi_type = self.ifi_type; - let ifi_typelen = self.ifi_typelen; - let ifi_physical = self.ifi_physical; - let ifi_addrlen = self.ifi_addrlen; - let ifi_hdrlen = self.ifi_hdrlen; - let ifi_recvquota = self.ifi_recvquota; - let ifi_xmitquota = self.ifi_xmitquota; - let ifi_unused1 = self.ifi_unused1; - let ifi_mtu = self.ifi_mtu; - let ifi_metric = self.ifi_metric; - let ifi_baudrate = self.ifi_baudrate; - let ifi_ipackets = self.ifi_ipackets; - let ifi_ierrors = self.ifi_ierrors; - let ifi_opackets = self.ifi_opackets; - let ifi_oerrors = self.ifi_oerrors; - let ifi_collisions = self.ifi_collisions; - let ifi_ibytes = self.ifi_ibytes; - let ifi_obytes = self.ifi_obytes; - let ifi_imcasts = self.ifi_imcasts; - let ifi_omcasts = self.ifi_omcasts; - let ifi_iqdrops = self.ifi_iqdrops; - let ifi_noproto = self.ifi_noproto; - let ifi_recvtiming = self.ifi_recvtiming; - let ifi_xmittiming = self.ifi_xmittiming; - let ifi_lastchange = self.ifi_lastchange; - f.debug_struct("if_data64") - .field("ifi_type", &ifi_type) - .field("ifi_typelen", &ifi_typelen) - .field("ifi_physical", &ifi_physical) - .field("ifi_addrlen", &ifi_addrlen) - .field("ifi_hdrlen", &ifi_hdrlen) - .field("ifi_recvquota", &ifi_recvquota) - .field("ifi_xmitquota", &ifi_xmitquota) - .field("ifi_unused1", &ifi_unused1) - .field("ifi_mtu", &ifi_mtu) - .field("ifi_metric", &ifi_metric) - .field("ifi_baudrate", &ifi_baudrate) - .field("ifi_ipackets", &ifi_ipackets) - .field("ifi_ierrors", &ifi_ierrors) - .field("ifi_opackets", &ifi_opackets) - .field("ifi_oerrors", &ifi_oerrors) - .field("ifi_collisions", &ifi_collisions) - .field("ifi_ibytes", &ifi_ibytes) - .field("ifi_obytes", &ifi_obytes) - .field("ifi_imcasts", &ifi_imcasts) - .field("ifi_omcasts", &ifi_omcasts) - .field("ifi_iqdrops", &ifi_iqdrops) - .field("ifi_noproto", &ifi_noproto) - .field("ifi_recvtiming", &ifi_recvtiming) - .field("ifi_xmittiming", &ifi_xmittiming) - .field("ifi_lastchange", &ifi_lastchange) - .finish() - } - } impl hash::Hash for if_data64 { fn hash(&self, state: &mut H) { let ifi_type = self.ifi_type; @@ -2690,34 +2366,6 @@ cfg_if! { } } impl Eq for if_msghdr2 {} - impl fmt::Debug for if_msghdr2 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ifm_msglen = self.ifm_msglen; - let ifm_version = self.ifm_version; - let ifm_type = self.ifm_type; - let ifm_addrs = self.ifm_addrs; - let ifm_flags = self.ifm_flags; - let ifm_index = self.ifm_index; - let ifm_snd_len = self.ifm_snd_len; - let ifm_snd_maxlen = self.ifm_snd_maxlen; - let ifm_snd_drops = self.ifm_snd_drops; - let ifm_timer = self.ifm_timer; - let ifm_data = self.ifm_data; - f.debug_struct("if_msghdr2") - .field("ifm_msglen", &ifm_msglen) - .field("ifm_version", &ifm_version) - .field("ifm_type", &ifm_type) - .field("ifm_addrs", &ifm_addrs) - .field("ifm_flags", &ifm_flags) - .field("ifm_index", &ifm_index) - .field("ifm_snd_len", &ifm_snd_len) - .field("ifm_snd_maxlen", &ifm_snd_maxlen) - .field("ifm_snd_drops", &ifm_snd_drops) - .field("ifm_timer", &ifm_timer) - .field("ifm_data", &ifm_data) - .finish() - } - } impl hash::Hash for if_msghdr2 { fn hash(&self, state: &mut H) { let ifm_msglen = self.ifm_msglen; @@ -2775,64 +2423,6 @@ cfg_if! { } } impl Eq for vm_statistics64 {} - impl fmt::Debug for vm_statistics64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let free_count = self.free_count; - let active_count = self.active_count; - let inactive_count = self.inactive_count; - let wire_count = self.wire_count; - let zero_fill_count = self.zero_fill_count; - let reactivations = self.reactivations; - let pageins = self.pageins; - let pageouts = self.pageouts; - let faults = self.faults; - let cow_faults = self.cow_faults; - let lookups = self.lookups; - let hits = self.hits; - let purges = self.purges; - let purgeable_count = self.purgeable_count; - let speculative_count = self.speculative_count; - let decompressions = self.decompressions; - let compressions = self.compressions; - let swapins = self.swapins; - let swapouts = self.swapouts; - let compressor_page_count = self.compressor_page_count; - let throttled_count = self.throttled_count; - let external_page_count = self.external_page_count; - let internal_page_count = self.internal_page_count; - // Otherwise rustfmt crashes... - let total_uncompressed = self.total_uncompressed_pages_in_compressor; - f.debug_struct("vm_statistics64") - .field("free_count", &free_count) - .field("active_count", &active_count) - .field("inactive_count", &inactive_count) - .field("wire_count", &wire_count) - .field("zero_fill_count", &zero_fill_count) - .field("reactivations", &reactivations) - .field("pageins", &pageins) - .field("pageouts", &pageouts) - .field("faults", &faults) - .field("cow_faults", &cow_faults) - .field("lookups", &lookups) - .field("hits", &hits) - .field("purges", &purges) - .field("purgeable_count", &purgeable_count) - .field("speculative_count", &speculative_count) - .field("decompressions", &decompressions) - .field("compressions", &compressions) - .field("swapins", &swapins) - .field("swapouts", &swapouts) - .field("compressor_page_count", &compressor_page_count) - .field("throttled_count", &throttled_count) - .field("external_page_count", &external_page_count) - .field("internal_page_count", &internal_page_count) - .field( - "total_uncompressed_pages_in_compressor", - &total_uncompressed, - ) - .finish() - } - } impl hash::Hash for vm_statistics64 { fn hash(&self, state: &mut H) { let free_count = self.free_count; @@ -2899,26 +2489,6 @@ cfg_if! { } } impl Eq for mach_task_basic_info {} - impl fmt::Debug for mach_task_basic_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let virtual_size = self.virtual_size; - let resident_size = self.resident_size; - let resident_size_max = self.resident_size_max; - let user_time = self.user_time; - let system_time = self.system_time; - let policy = self.policy; - let suspend_count = self.suspend_count; - f.debug_struct("mach_task_basic_info") - .field("virtual_size", &virtual_size) - .field("resident_size", &resident_size) - .field("resident_size_max", &resident_size_max) - .field("user_time", &user_time) - .field("system_time", &system_time) - .field("policy", &policy) - .field("suspend_count", &suspend_count) - .finish() - } - } impl hash::Hash for mach_task_basic_info { fn hash(&self, state: &mut H) { let virtual_size = self.virtual_size; @@ -2946,18 +2516,6 @@ cfg_if! { } } impl Eq for log2phys {} - impl fmt::Debug for log2phys { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let l2p_flags = self.l2p_flags; - let l2p_contigbytes = self.l2p_contigbytes; - let l2p_devoffset = self.l2p_devoffset; - f.debug_struct("log2phys") - .field("l2p_flags", &l2p_flags) - .field("l2p_contigbytes", &l2p_contigbytes) - .field("l2p_devoffset", &l2p_devoffset) - .finish() - } - } impl hash::Hash for log2phys { fn hash(&self, state: &mut H) { let l2p_flags = self.l2p_flags; @@ -2976,14 +2534,6 @@ cfg_if! { impl Eq for os_unfair_lock {} - impl fmt::Debug for os_unfair_lock { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("os_unfair_lock") - .field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque) - .finish() - } - } - impl hash::Hash for os_unfair_lock { fn hash(&self, state: &mut H) { self._os_unfair_lock_opaque.hash(state); @@ -3002,24 +2552,6 @@ cfg_if! { impl Eq for sockaddr_vm {} - impl fmt::Debug for sockaddr_vm { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let svm_len = self.svm_len; - let svm_family = self.svm_family; - let svm_reserved1 = self.svm_reserved1; - let svm_port = self.svm_port; - let svm_cid = self.svm_cid; - - f.debug_struct("sockaddr_vm") - .field("svm_len", &svm_len) - .field("svm_family", &svm_family) - .field("svm_reserved1", &svm_reserved1) - .field("svm_port", &svm_port) - .field("svm_cid", &svm_cid) - .finish() - } - } - impl hash::Hash for sockaddr_vm { fn hash(&self, state: &mut H) { let svm_len = self.svm_len; @@ -3046,16 +2578,6 @@ cfg_if! { impl Eq for ifdevmtu {} - impl fmt::Debug for ifdevmtu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifdevmtu") - .field("ifdm_current", &self.ifdm_current) - .field("ifdm_min", &self.ifdm_min) - .field("ifdm_max", &self.ifdm_max) - .finish() - } - } - impl hash::Hash for ifdevmtu { fn hash(&self, state: &mut H) { self.ifdm_current.hash(state); @@ -3088,15 +2610,6 @@ cfg_if! { impl Eq for ifkpi {} - impl fmt::Debug for ifkpi { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifkpi") - .field("ifk_module_id", &self.ifk_module_id) - .field("ifk_type", &self.ifk_type) - .finish() - } - } - impl hash::Hash for ifkpi { fn hash(&self, state: &mut H) { self.ifk_module_id.hash(state); @@ -3164,15 +2677,6 @@ cfg_if! { impl Eq for ifreq {} - impl fmt::Debug for ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } - impl hash::Hash for ifreq { fn hash(&self, state: &mut H) { self.ifr_name.hash(state); @@ -3238,15 +2742,6 @@ cfg_if! { } impl Eq for in6_ifreq {} - - impl fmt::Debug for in6_ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("in6_ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } } } diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 5534c1390b911..168c85094f5be 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -554,24 +554,6 @@ cfg_if! { } } impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_name", &self.ut_name) - .field("ut_id", &self.ut_id) - .field("ut_line", &self.ut_line) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_unused", &self.ut_unused) - .field("ut_session", &self.ut_session) - .field("ut_type", &self.ut_type) - .field("ut_pid", &self.ut_pid) - .field("ut_exit", &self.ut_exit) - .field("ut_ss", &self.ut_ss) - .field("ut_tv", &self.ut_tv) - .field("ut_unused2", &self.ut_unused2) - .finish() - } - } impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_name.hash(state); @@ -597,16 +579,6 @@ cfg_if! { } } impl Eq for lastlogx {} - impl fmt::Debug for lastlogx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("lastlogx") - .field("ll_tv", &self.ll_tv) - .field("ll_line", &self.ll_line) - .field("ll_host", &self.ll_host) - .field("ll_ss", &self.ll_ss) - .finish() - } - } impl hash::Hash for lastlogx { fn hash(&self, state: &mut H) { self.ll_tv.hash(state); @@ -631,18 +603,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_namlen", &self.d_namlen) - .field("d_type", &self.d_type) - // Ignore __unused1 - // Ignore __unused2 - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -685,29 +645,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_fsid", &self.f_fsid) - .field("f_owner", &self.f_owner) - .field("f_type", &self.f_type) - .field("f_flags", &self.f_flags) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - // FIXME(debug): .field("f_mntonname", &self.f_mntonname) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_bsize.hash(state); @@ -739,15 +676,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); @@ -790,42 +718,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_onstack", &self.mc_onstack) - .field("mc_rdi", &self.mc_rdi) - .field("mc_rsi", &self.mc_rsi) - .field("mc_rdx", &self.mc_rdx) - .field("mc_rcx", &self.mc_rcx) - .field("mc_r8", &self.mc_r8) - .field("mc_r9", &self.mc_r9) - .field("mc_rax", &self.mc_rax) - .field("mc_rbx", &self.mc_rbx) - .field("mc_rbp", &self.mc_rbp) - .field("mc_r10", &self.mc_r10) - .field("mc_r11", &self.mc_r11) - .field("mc_r12", &self.mc_r12) - .field("mc_r13", &self.mc_r13) - .field("mc_r14", &self.mc_r14) - .field("mc_r15", &self.mc_r15) - .field("mc_xflags", &self.mc_xflags) - .field("mc_trapno", &self.mc_trapno) - .field("mc_addr", &self.mc_addr) - .field("mc_flags", &self.mc_flags) - .field("mc_err", &self.mc_err) - .field("mc_rip", &self.mc_rip) - .field("mc_cs", &self.mc_cs) - .field("mc_rflags", &self.mc_rflags) - .field("mc_rsp", &self.mc_rsp) - .field("mc_ss", &self.mc_ss) - .field("mc_len", &self.mc_len) - .field("mc_fpformat", &self.mc_fpformat) - .field("mc_ownedfp", &self.mc_ownedfp) - .field("mc_fpregs", &self.mc_fpregs) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_onstack.hash(state); @@ -875,18 +767,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_sigmask", &self.uc_sigmask) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_cofunc", &self.uc_cofunc) - .field("uc_arg", &self.uc_arg) - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_sigmask.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs index ae93648ebd94f..7f5693dcf5d5c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -48,18 +48,6 @@ cfg_if! { } } impl Eq for gpregs {} - impl fmt::Debug for gpregs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("gpregs") - .field("gp_x", &self.gp_x) - .field("gp_lr", &self.gp_lr) - .field("gp_sp", &self.gp_sp) - .field("gp_elr", &self.gp_elr) - .field("gp_spsr", &self.gp_spsr) - .field("gp_pad", &self.gp_pad) - .finish() - } - } impl hash::Hash for gpregs { fn hash(&self, state: &mut H) { self.gp_x.hash(state); @@ -80,17 +68,6 @@ cfg_if! { } } impl Eq for fpregs {} - impl fmt::Debug for fpregs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpregs") - .field("fp_q", &self.fp_q) - .field("fp_sr", &self.fp_sr) - .field("fp_cr", &self.fp_cr) - .field("fp_flags", &self.fp_flags) - .field("fp_pad", &self.fp_pad) - .finish() - } - } impl hash::Hash for fpregs { fn hash(&self, state: &mut H) { self.fp_q.hash(state); @@ -114,17 +91,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_gpregs", &self.mc_gpregs) - .field("mc_fpregs", &self.mc_fpregs) - .field("mc_flags", &self.mc_flags) - .field("mc_pad", &self.mc_pad) - .field("mc_spare", &self.mc_spare) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_gpregs.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs index e29c9cef3981e..27eeafe200f53 100644 --- a/src/unix/bsd/freebsdlike/freebsd/arm.rs +++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs @@ -32,16 +32,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("__gregs", &self.__gregs) - .field("mc_vfp_size", &self.mc_vfp_size) - .field("mc_vfp_ptr", &self.mc_vfp_ptr) - .field("mc_spare", &self.mc_spare) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.__gregs.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index 584644701aea2..9705e300bd9ac 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -296,29 +296,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_fsid", &self.f_fsid) - .field("f_fstypename", &self.f_fstypename) - .field("f_mntfromname", &&self.f_mntfromname[..]) - .field("f_mntonname", &&self.f_mntonname[..]) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_version.hash(state); @@ -357,17 +334,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - .field("d_name", &&self.d_name[..self.d_namlen as _]) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -394,22 +360,6 @@ cfg_if! { } } impl Eq for vnstat {} - impl fmt::Debug for vnstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_vn_devname: &[c_char] = &self.vn_devname; - - f.debug_struct("vnstat") - .field("vn_fileid", &self.vn_fileid) - .field("vn_size", &self.vn_size) - .field("vn_mntdir", &self.vn_mntdir) - .field("vn_dev", &self.vn_dev) - .field("vn_fsid", &self.vn_fsid) - .field("vn_type", &self.vn_type) - .field("vn_mode", &self.vn_mode) - .field("vn_devname", &self_vn_devname) - .finish() - } - } impl hash::Hash for vnstat { fn hash(&self, state: &mut H) { let self_vn_devname: &[c_char] = &self.vn_devname; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index 21062e50afcbd..005b26894cc81 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -340,29 +340,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_fsid", &self.f_fsid) - .field("f_fstypename", &self.f_fstypename) - .field("f_mntfromname", &&self.f_mntfromname[..]) - .field("f_mntonname", &&self.f_mntonname[..]) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_version.hash(state); @@ -403,18 +380,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - .field("d_name", &&self.d_name[..self.d_namlen as _]) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -442,22 +407,6 @@ cfg_if! { } } impl Eq for vnstat {} - impl fmt::Debug for vnstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_vn_devname: &[c_char] = &self.vn_devname; - - f.debug_struct("vnstat") - .field("vn_fileid", &self.vn_fileid) - .field("vn_size", &self.vn_size) - .field("vn_dev", &self.vn_dev) - .field("vn_fsid", &self.vn_fsid) - .field("vn_mntdir", &self.vn_mntdir) - .field("vn_type", &self.vn_type) - .field("vn_mode", &self.vn_mode) - .field("vn_devname", &self_vn_devname) - .finish() - } - } impl hash::Hash for vnstat { fn hash(&self, state: &mut H) { let self_vn_devname: &[c_char] = &self.vn_devname; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index 505d2d1591652..5c40a355fb95b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -353,29 +353,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_fsid", &self.f_fsid) - .field("f_fstypename", &self.f_fstypename) - .field("f_mntfromname", &&self.f_mntfromname[..]) - .field("f_mntonname", &&self.f_mntonname[..]) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_version.hash(state); @@ -416,18 +393,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - .field("d_name", &&self.d_name[..self.d_namlen as _]) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -455,22 +420,6 @@ cfg_if! { } } impl Eq for vnstat {} - impl fmt::Debug for vnstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_vn_devname: &[c_char] = &self.vn_devname; - - f.debug_struct("vnstat") - .field("vn_fileid", &self.vn_fileid) - .field("vn_size", &self.vn_size) - .field("vn_dev", &self.vn_dev) - .field("vn_fsid", &self.vn_fsid) - .field("vn_mntdir", &self.vn_mntdir) - .field("vn_type", &self.vn_type) - .field("vn_mode", &self.vn_mode) - .field("vn_devname", &self_vn_devname) - .finish() - } - } impl hash::Hash for vnstat { fn hash(&self, state: &mut H) { let self_vn_devname: &[c_char] = &self.vn_devname; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index 44a3656d674f7..de1001b26fab9 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -353,29 +353,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_fsid", &self.f_fsid) - .field("f_fstypename", &self.f_fstypename) - .field("f_mntfromname", &&self.f_mntfromname[..]) - .field("f_mntonname", &&self.f_mntonname[..]) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_version.hash(state); @@ -416,18 +393,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - .field("d_name", &&self.d_name[..self.d_namlen as _]) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -455,22 +420,6 @@ cfg_if! { } } impl Eq for vnstat {} - impl fmt::Debug for vnstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_vn_devname: &[c_char] = &self.vn_devname; - - f.debug_struct("vnstat") - .field("vn_fileid", &self.vn_fileid) - .field("vn_size", &self.vn_size) - .field("vn_dev", &self.vn_dev) - .field("vn_fsid", &self.vn_fsid) - .field("vn_mntdir", &self.vn_mntdir) - .field("vn_type", &self.vn_type) - .field("vn_mode", &self.vn_mode) - .field("vn_devname", &self_vn_devname) - .finish() - } - } impl hash::Hash for vnstat { fn hash(&self, state: &mut H) { let self_vn_devname: &[c_char] = &self.vn_devname; diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs index 29c9c0cb94fff..6a02d7b35c186 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs @@ -354,29 +354,6 @@ cfg_if! { } } impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_fsid", &self.f_fsid) - .field("f_fstypename", &self.f_fstypename) - .field("f_mntfromname", &&self.f_mntfromname[..]) - .field("f_mntonname", &&self.f_mntonname[..]) - .finish() - } - } impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_version.hash(state); @@ -417,18 +394,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - .field("d_name", &&self.d_name[..self.d_namlen as _]) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -456,22 +421,6 @@ cfg_if! { } } impl Eq for vnstat {} - impl fmt::Debug for vnstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_vn_devname: &[c_char] = &self.vn_devname; - - f.debug_struct("vnstat") - .field("vn_fileid", &self.vn_fileid) - .field("vn_size", &self.vn_size) - .field("vn_dev", &self.vn_dev) - .field("vn_fsid", &self.vn_fsid) - .field("vn_mntdir", &self.vn_mntdir) - .field("vn_type", &self.vn_type) - .field("vn_mode", &self.vn_mode) - .field("vn_devname", &self_vn_devname) - .finish() - } - } impl hash::Hash for vnstat { fn hash(&self, state: &mut H) { let self_vn_devname: &[c_char] = &self.vn_devname; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index c88967e6fce58..bd4601576294a 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1726,20 +1726,6 @@ cfg_if! { } } impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_type", &self.ut_type) - .field("ut_tv", &self.ut_tv) - .field("ut_id", &self.ut_id) - .field("ut_pid", &self.ut_pid) - .field("ut_user", &self.ut_user) - .field("ut_line", &self.ut_line) - // FIXME(debug): .field("ut_host", &self.ut_host) - // FIXME(debug): .field("__ut_spare", &self.__ut_spare) - .finish() - } - } impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_type.hash(state); @@ -1775,17 +1761,6 @@ cfg_if! { } } impl Eq for xucred {} - impl fmt::Debug for xucred { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("xucred") - .field("cr_version", &self.cr_version) - .field("cr_uid", &self.cr_uid) - .field("cr_ngroups", &self.cr_ngroups) - .field("cr_groups", &self.cr_groups) - .field("cr_pid__c_anonymous_union", &self.cr_pid__c_anonymous_union) - .finish() - } - } impl hash::Hash for xucred { fn hash(&self, state: &mut H) { self.cr_version.hash(state); @@ -1813,20 +1788,6 @@ cfg_if! { } } impl Eq for sockaddr_dl {} - impl fmt::Debug for sockaddr_dl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_dl") - .field("sdl_len", &self.sdl_len) - .field("sdl_family", &self.sdl_family) - .field("sdl_index", &self.sdl_index) - .field("sdl_type", &self.sdl_type) - .field("sdl_nlen", &self.sdl_nlen) - .field("sdl_alen", &self.sdl_alen) - .field("sdl_slen", &self.sdl_slen) - // FIXME(debug): .field("sdl_data", &self.sdl_data) - .finish() - } - } impl hash::Hash for sockaddr_dl { fn hash(&self, state: &mut H) { self.sdl_len.hash(state); @@ -1849,16 +1810,6 @@ cfg_if! { } } impl Eq for mq_attr {} - impl fmt::Debug for mq_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mq_attr") - .field("mq_flags", &self.mq_flags) - .field("mq_maxmsg", &self.mq_maxmsg) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_curmsgs", &self.mq_curmsgs) - .finish() - } - } impl hash::Hash for mq_attr { fn hash(&self, state: &mut H) { self.mq_flags.hash(state); @@ -1877,16 +1828,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("sigev_notify_thread_id", &self.sigev_notify_thread_id) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); @@ -1905,16 +1846,6 @@ cfg_if! { } } impl Eq for ptsstat {} - impl fmt::Debug for ptsstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let self_devname: &[c_char] = &self.devname; - - f.debug_struct("ptsstat") - .field("dev", &self.dev) - .field("devname", &self_devname) - .finish() - } - } impl hash::Hash for ptsstat { fn hash(&self, state: &mut H) { let self_devname: &[c_char] = &self.devname; @@ -1936,14 +1867,6 @@ cfg_if! { } } impl Eq for Elf32_Auxinfo {} - impl fmt::Debug for Elf32_Auxinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Elf32_Auxinfo") - .field("a_type", &self.a_type) - .field("a_un", &self.a_un) - .finish() - } - } impl PartialEq for __c_anonymous_ifr_ifru { fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { @@ -1993,14 +1916,6 @@ cfg_if! { } } impl Eq for ifreq {} - impl fmt::Debug for ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } impl hash::Hash for ifreq { fn hash(&self, state: &mut H) { self.ifr_name.hash(state); @@ -2032,16 +1947,6 @@ cfg_if! { } } impl Eq for ifstat {} - impl fmt::Debug for ifstat { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ascii: &[c_char] = &self.ascii; - - f.debug_struct("ifstat") - .field("ifs_name", &self.ifs_name) - .field("ascii", &ascii) - .finish() - } - } impl hash::Hash for ifstat { fn hash(&self, state: &mut H) { self.ifs_name.hash(state); @@ -2062,19 +1967,6 @@ cfg_if! { } } impl Eq for ifrsskey {} - impl fmt::Debug for ifrsskey { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ifrk_key: &[u8] = &self.ifrk_key; - - f.debug_struct("ifrsskey") - .field("ifrk_name", &self.ifrk_name) - .field("ifrk_func", &self.ifrk_func) - .field("ifrk_spare0", &self.ifrk_spare0) - .field("ifrk_keylen", &self.ifrk_keylen) - .field("ifrk_key", &ifrk_key) - .finish() - } - } impl hash::Hash for ifrsskey { fn hash(&self, state: &mut H) { self.ifrk_name.hash(state); @@ -2097,18 +1989,6 @@ cfg_if! { } } impl Eq for ifdownreason {} - impl fmt::Debug for ifdownreason { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ifdr_msg: &[c_char] = &self.ifdr_msg; - - f.debug_struct("ifdownreason") - .field("ifdr_name", &self.ifdr_name) - .field("ifdr_reason", &self.ifdr_reason) - .field("ifdr_vendor", &self.ifdr_vendor) - .field("ifdr_msg", &ifdr_msg) - .finish() - } - } impl hash::Hash for ifdownreason { fn hash(&self, state: &mut H) { self.ifdr_name.hash(state); @@ -2178,37 +2058,6 @@ cfg_if! { } } impl Eq for if_data {} - impl fmt::Debug for if_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("if_data") - .field("ifi_type", &self.ifi_type) - .field("ifi_physical", &self.ifi_physical) - .field("ifi_addrlen", &self.ifi_addrlen) - .field("ifi_hdrlen", &self.ifi_hdrlen) - .field("ifi_link_state", &self.ifi_link_state) - .field("ifi_vhid", &self.ifi_vhid) - .field("ifi_datalen", &self.ifi_datalen) - .field("ifi_mtu", &self.ifi_mtu) - .field("ifi_metric", &self.ifi_metric) - .field("ifi_baudrate", &self.ifi_baudrate) - .field("ifi_ipackets", &self.ifi_ipackets) - .field("ifi_ierrors", &self.ifi_ierrors) - .field("ifi_opackets", &self.ifi_opackets) - .field("ifi_oerrors", &self.ifi_oerrors) - .field("ifi_collisions", &self.ifi_collisions) - .field("ifi_ibytes", &self.ifi_ibytes) - .field("ifi_obytes", &self.ifi_obytes) - .field("ifi_imcasts", &self.ifi_imcasts) - .field("ifi_omcasts", &self.ifi_omcasts) - .field("ifi_iqdrops", &self.ifi_iqdrops) - .field("ifi_oqdrops", &self.ifi_oqdrops) - .field("ifi_noproto", &self.ifi_noproto) - .field("ifi_hwassist", &self.ifi_hwassist) - .field("__ifi_epoch", &self.__ifi_epoch) - .field("__ifi_lastchange", &self.__ifi_lastchange) - .finish() - } - } impl hash::Hash for if_data { fn hash(&self, state: &mut H) { self.ifi_type.hash(state); @@ -2248,16 +2097,6 @@ cfg_if! { } } impl Eq for sctphdr {} - impl fmt::Debug for sctphdr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctphdr") - .field("src_port", &{ self.src_port }) - .field("dest_port", &{ self.dest_port }) - .field("v_tag", &{ self.v_tag }) - .field("checksum", &{ self.checksum }) - .finish() - } - } impl hash::Hash for sctphdr { fn hash(&self, state: &mut H) { { self.src_port }.hash(state); @@ -2275,15 +2114,6 @@ cfg_if! { } } impl Eq for sctp_chunkhdr {} - impl fmt::Debug for sctp_chunkhdr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_chunkhdr") - .field("chunk_type", &{ self.chunk_type }) - .field("chunk_flags", &{ self.chunk_flags }) - .field("chunk_length", &{ self.chunk_length }) - .finish() - } - } impl hash::Hash for sctp_chunkhdr { fn hash(&self, state: &mut H) { { self.chunk_type }.hash(state); @@ -2300,14 +2130,6 @@ cfg_if! { } } impl Eq for sctp_paramhdr {} - impl fmt::Debug for sctp_paramhdr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_paramhdr") - .field("param_type", &{ self.param_type }) - .field("param_length", &{ self.param_length }) - .finish() - } - } impl hash::Hash for sctp_paramhdr { fn hash(&self, state: &mut H) { { self.param_type }.hash(state); @@ -2326,15 +2148,6 @@ cfg_if! { } } impl Eq for sctp_gen_error_cause {} - impl fmt::Debug for sctp_gen_error_cause { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_gen_error_cause") - .field("code", &{ self.code }) - .field("length", &{ self.length }) - // FIXME(debug): .field("info", &{self.info}) - .finish() - } - } impl hash::Hash for sctp_gen_error_cause { fn hash(&self, state: &mut H) { { self.code }.hash(state); @@ -2349,14 +2162,6 @@ cfg_if! { } } impl Eq for sctp_error_cause {} - impl fmt::Debug for sctp_error_cause { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_cause") - .field("code", &{ self.code }) - .field("length", &{ self.length }) - .finish() - } - } impl hash::Hash for sctp_error_cause { fn hash(&self, state: &mut H) { { self.code }.hash(state); @@ -2372,14 +2177,6 @@ cfg_if! { } } impl Eq for sctp_error_invalid_stream {} - impl fmt::Debug for sctp_error_invalid_stream { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_invalid_stream") - .field("cause", &{ self.cause }) - .field("stream_id", &{ self.stream_id }) - .finish() - } - } impl hash::Hash for sctp_error_invalid_stream { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2398,15 +2195,6 @@ cfg_if! { } } impl Eq for sctp_error_missing_param {} - impl fmt::Debug for sctp_error_missing_param { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_missing_param") - .field("cause", &{ self.cause }) - .field("num_missing_params", &{ self.num_missing_params }) - // FIXME(debug): .field("tpe", &{self.tpe}) - .finish() - } - } impl hash::Hash for sctp_error_missing_param { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2423,14 +2211,6 @@ cfg_if! { } } impl Eq for sctp_error_stale_cookie {} - impl fmt::Debug for sctp_error_stale_cookie { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_stale_cookie") - .field("cause", &{ self.cause }) - .field("stale_time", &{ self.stale_time }) - .finish() - } - } impl hash::Hash for sctp_error_stale_cookie { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2444,13 +2224,6 @@ cfg_if! { } } impl Eq for sctp_error_out_of_resource {} - impl fmt::Debug for sctp_error_out_of_resource { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_out_of_resource") - .field("cause", &{ self.cause }) - .finish() - } - } impl hash::Hash for sctp_error_out_of_resource { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2463,13 +2236,6 @@ cfg_if! { } } impl Eq for sctp_error_unresolv_addr {} - impl fmt::Debug for sctp_error_unresolv_addr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_unresolv_addr") - .field("cause", &{ self.cause }) - .finish() - } - } impl hash::Hash for sctp_error_unresolv_addr { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2482,14 +2248,6 @@ cfg_if! { } } impl Eq for sctp_error_unrecognized_chunk {} - impl fmt::Debug for sctp_error_unrecognized_chunk { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_unrecognized_chunk") - .field("cause", &{ self.cause }) - .field("ch", &{ self.ch }) - .finish() - } - } impl hash::Hash for sctp_error_unrecognized_chunk { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2503,14 +2261,6 @@ cfg_if! { } } impl Eq for sctp_error_no_user_data {} - impl fmt::Debug for sctp_error_no_user_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_no_user_data") - .field("cause", &{ self.cause }) - .field("tsn", &{ self.tsn }) - .finish() - } - } impl hash::Hash for sctp_error_no_user_data { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2524,14 +2274,6 @@ cfg_if! { } } impl Eq for sctp_error_auth_invalid_hmac {} - impl fmt::Debug for sctp_error_auth_invalid_hmac { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sctp_error_invalid_hmac") - .field("cause", &{ self.cause }) - .field("hmac_id", &{ self.hmac_id }) - .finish() - } - } impl hash::Hash for sctp_error_auth_invalid_hmac { fn hash(&self, state: &mut H) { { self.cause }.hash(state); @@ -2557,21 +2299,6 @@ cfg_if! { } } impl Eq for kinfo_file {} - impl fmt::Debug for kinfo_file { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("kinfo_file") - .field("kf_structsize", &self.kf_structsize) - .field("kf_type", &self.kf_type) - .field("kf_fd", &self.kf_fd) - .field("kf_ref_count", &self.kf_ref_count) - .field("kf_flags", &self.kf_flags) - .field("kf_offset", &self.kf_offset) - .field("kf_status", &self.kf_status) - .field("kf_cap_rights", &self.kf_cap_rights) - .field("kf_path", &&self.kf_path[..]) - .finish() - } - } impl hash::Hash for kinfo_file { fn hash(&self, state: &mut H) { self.kf_structsize.hash(state); @@ -2585,18 +2312,6 @@ cfg_if! { self.kf_path.hash(state); } } - - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_sigmask", &self.uc_sigmask) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_flags", &self.uc_flags) - .finish() - } - } } } diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs index 9fde25d37b62f..a6d9ed6d7f4da 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs @@ -37,21 +37,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_vers", &self.mc_vers) - .field("mc_flags", &self.mc_flags) - .field("mc_onstack", &self.mc_onstack) - .field("mc_len", &self.mc_len) - .field("mc_avec", &self.mc_avec) - .field("mc_av", &self.mc_av) - .field("mc_frame", &self.mc_frame) - .field("mc_fpreg", &self.mc_fpreg) - .field("mc_vsxfpreg", &self.mc_vsxfpreg) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_vers.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs index e7df7f7737997..87b425ad9b096 100644 --- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs @@ -37,21 +37,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_vers", &self.mc_vers) - .field("mc_flags", &self.mc_flags) - .field("mc_onstack", &self.mc_onstack) - .field("mc_len", &self.mc_len) - .field("mc_avec", &self.mc_avec) - .field("mc_av", &self.mc_av) - .field("mc_frame", &self.mc_frame) - .field("mc_fpreg", &self.mc_fpreg) - .field("mc_vsxfpreg", &self.mc_vsxfpreg) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_vers.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs index 449a29f7d3df4..bc065cfa58fae 100644 --- a/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +++ b/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -51,21 +51,6 @@ cfg_if! { } } impl Eq for gpregs {} - impl fmt::Debug for gpregs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("gpregs") - .field("gp_ra", &self.gp_ra) - .field("gp_sp", &self.gp_sp) - .field("gp_gp", &self.gp_gp) - .field("gp_tp", &self.gp_tp) - .field("gp_t", &self.gp_t) - .field("gp_s", &self.gp_s) - .field("gp_a", &self.gp_a) - .field("gp_sepc", &self.gp_sepc) - .field("gp_sstatus", &self.gp_sstatus) - .finish() - } - } impl hash::Hash for gpregs { fn hash(&self, state: &mut H) { self.gp_ra.hash(state); @@ -88,16 +73,6 @@ cfg_if! { } } impl Eq for fpregs {} - impl fmt::Debug for fpregs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpregs") - .field("fp_x", &self.fp_x) - .field("fp_fcsr", &self.fp_fcsr) - .field("fp_flags", &self.fp_flags) - .field("pad", &self.pad) - .finish() - } - } impl hash::Hash for fpregs { fn hash(&self, state: &mut H) { self.fp_x.hash(state); @@ -120,17 +95,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_gpregs", &self.mc_gpregs) - .field("mc_fpregs", &self.mc_fpregs) - .field("mc_flags", &self.mc_flags) - .field("mc_pad", &self.mc_pad) - .field("mc_spare", &self.mc_spare) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_gpregs.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs index b196eafe06ab8..b739719340438 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -87,42 +87,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_onstack", &self.mc_onstack) - .field("mc_gs", &self.mc_gs) - .field("mc_fs", &self.mc_fs) - .field("mc_es", &self.mc_es) - .field("mc_ds", &self.mc_ds) - .field("mc_edi", &self.mc_edi) - .field("mc_esi", &self.mc_esi) - .field("mc_ebp", &self.mc_ebp) - .field("mc_isp", &self.mc_isp) - .field("mc_ebx", &self.mc_ebx) - .field("mc_edx", &self.mc_edx) - .field("mc_ecx", &self.mc_ecx) - .field("mc_eax", &self.mc_eax) - .field("mc_trapno", &self.mc_trapno) - .field("mc_err", &self.mc_err) - .field("mc_eip", &self.mc_eip) - .field("mc_cs", &self.mc_cs) - .field("mc_eflags", &self.mc_eflags) - .field("mc_esp", &self.mc_esp) - .field("mc_ss", &self.mc_ss) - .field("mc_len", &self.mc_len) - .field("mc_fpformat", &self.mc_fpformat) - .field("mc_ownedfp", &self.mc_ownedfp) - .field("mc_flags", &self.mc_flags) - .field("mc_fpstate", &self.mc_fpstate) - .field("mc_fsbase", &self.mc_fsbase) - .field("mc_gsbase", &self.mc_gsbase) - .field("mc_xfpustate", &self.mc_xfpustate) - .field("mc_xfpustate_len", &self.mc_xfpustate_len) - .field("mc_spare2", &self.mc_spare2) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_onstack.hash(state); diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs index 065847043225c..40e1d72e2041e 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -156,16 +156,6 @@ cfg_if! { } } impl Eq for fpreg32 {} - impl fmt::Debug for fpreg32 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpreg32") - .field("fpr_env", &&self.fpr_env[..]) - .field("fpr_acc", &self.fpr_acc) - .field("fpr_ex_sw", &self.fpr_ex_sw) - .field("fpr_pad", &&self.fpr_pad[..]) - .finish() - } - } impl hash::Hash for fpreg32 { fn hash(&self, state: &mut H) { self.fpr_env.hash(state); @@ -184,16 +174,6 @@ cfg_if! { } } impl Eq for fpreg {} - impl fmt::Debug for fpreg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpreg") - .field("fpr_env", &self.fpr_env) - .field("fpr_acc", &self.fpr_acc) - .field("fpr_xacc", &self.fpr_xacc) - .field("fpr_spare", &self.fpr_spare) - .finish() - } - } impl hash::Hash for fpreg { fn hash(&self, state: &mut H) { self.fpr_env.hash(state); @@ -216,16 +196,6 @@ cfg_if! { } } impl Eq for xmmreg {} - impl fmt::Debug for xmmreg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("xmmreg") - .field("xmm_env", &self.xmm_env) - .field("xmm_acc", &self.xmm_acc) - .field("xmm_reg", &self.xmm_reg) - .field("xmm_pad", &&self.xmm_pad[..]) - .finish() - } - } impl hash::Hash for xmmreg { fn hash(&self, state: &mut H) { self.xmm_env.hash(state); @@ -253,14 +223,6 @@ cfg_if! { } } impl Eq for Elf64_Auxinfo {} - impl fmt::Debug for Elf64_Auxinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Elf64_Auxinfo") - .field("a_type", &self.a_type) - .field("a_un", &self.a_un) - .finish() - } - } impl PartialEq for mcontext_t { fn eq(&self, other: &mcontext_t) -> bool { @@ -309,50 +271,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("mc_onstack", &self.mc_onstack) - .field("mc_rdi", &self.mc_rdi) - .field("mc_rsi", &self.mc_rsi) - .field("mc_rdx", &self.mc_rdx) - .field("mc_rcx", &self.mc_rcx) - .field("mc_r8", &self.mc_r8) - .field("mc_r9", &self.mc_r9) - .field("mc_rax", &self.mc_rax) - .field("mc_rbx", &self.mc_rbx) - .field("mc_rbp", &self.mc_rbp) - .field("mc_r10", &self.mc_r10) - .field("mc_r11", &self.mc_r11) - .field("mc_r12", &self.mc_r12) - .field("mc_r13", &self.mc_r13) - .field("mc_r14", &self.mc_r14) - .field("mc_r15", &self.mc_r15) - .field("mc_trapno", &self.mc_trapno) - .field("mc_fs", &self.mc_fs) - .field("mc_gs", &self.mc_gs) - .field("mc_addr", &self.mc_addr) - .field("mc_flags", &self.mc_flags) - .field("mc_es", &self.mc_es) - .field("mc_ds", &self.mc_ds) - .field("mc_err", &self.mc_err) - .field("mc_rip", &self.mc_rip) - .field("mc_cs", &self.mc_cs) - .field("mc_rflags", &self.mc_rflags) - .field("mc_rsp", &self.mc_rsp) - .field("mc_ss", &self.mc_ss) - .field("mc_len", &self.mc_len) - .field("mc_fpformat", &self.mc_fpformat) - .field("mc_ownedfp", &self.mc_ownedfp) - // FIXME(debug): .field("mc_fpstate", &self.mc_fpstate) - .field("mc_fsbase", &self.mc_fsbase) - .field("mc_gsbase", &self.mc_gsbase) - .field("mc_xfpustate", &self.mc_xfpustate) - .field("mc_xfpustate_len", &self.mc_xfpustate_len) - .field("mc_spare", &self.mc_spare) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.mc_onstack.hash(state); diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 197873cd17795..644e035e2c67a 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -414,17 +414,6 @@ cfg_if! { } } impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 1f84950fa1945..f2f17f4681a56 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -180,16 +180,6 @@ cfg_if! { impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_len", &self.sun_len) - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } - impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_len.hash(state); @@ -229,18 +219,6 @@ cfg_if! { impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - .finish() - } - } - impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 8633ee3dd5c08..3addd5a8a6e36 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -940,24 +940,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_name", &self.ut_name) - .field("ut_id", &self.ut_id) - .field("ut_line", &self.ut_line) - // FIXME(debug) .field("ut_host", &self.ut_host) - .field("ut_session", &self.ut_session) - .field("ut_type", &self.ut_type) - .field("ut_pid", &self.ut_pid) - .field("ut_exit", &self.ut_exit) - .field("ut_ss", &self.ut_ss) - .field("ut_tv", &self.ut_tv) - // FIXME(debug) .field("ut_pad", &self.ut_pad) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_name.hash(state); @@ -989,17 +971,6 @@ cfg_if! { impl Eq for lastlogx {} - impl fmt::Debug for lastlogx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("lastlogx") - .field("ll_tv", &self.ll_tv) - .field("ll_line", &self.ll_line) - // FIXME(debug).field("ll_host", &self.ll_host) - .field("ll_ss", &self.ll_ss) - .finish() - } - } - impl hash::Hash for lastlogx { fn hash(&self, state: &mut H) { self.ll_tv.hash(state); @@ -1015,14 +986,6 @@ cfg_if! { } } impl Eq for in_pktinfo {} - impl fmt::Debug for in_pktinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("in_pktinfo") - .field("ipi_addr", &self.ipi_addr) - .field("ipi_ifindex", &self.ipi_ifindex) - .finish() - } - } impl hash::Hash for in_pktinfo { fn hash(&self, state: &mut H) { self.ipi_addr.hash(state); @@ -1040,20 +1003,6 @@ cfg_if! { } } impl Eq for arphdr {} - impl fmt::Debug for arphdr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let ar_hrd = self.ar_hrd; - let ar_pro = self.ar_pro; - let ar_op = self.ar_op; - f.debug_struct("arphdr") - .field("ar_hrd", &ar_hrd) - .field("ar_pro", &ar_pro) - .field("ar_hln", &self.ar_hln) - .field("ar_pln", &self.ar_pln) - .field("ar_op", &ar_op) - .finish() - } - } impl hash::Hash for arphdr { fn hash(&self, state: &mut H) { let ar_hrd = self.ar_hrd; @@ -1073,12 +1022,6 @@ cfg_if! { } } impl Eq for in_addr {} - impl fmt::Debug for in_addr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let s_addr = self.s_addr; - f.debug_struct("in_addr").field("s_addr", &s_addr).finish() - } - } impl hash::Hash for in_addr { fn hash(&self, state: &mut H) { let s_addr = self.s_addr; @@ -1093,14 +1036,6 @@ cfg_if! { } } impl Eq for ip_mreq {} - impl fmt::Debug for ip_mreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ip_mreq") - .field("imr_multiaddr", &self.imr_multiaddr) - .field("imr_interface", &self.imr_interface) - .finish() - } - } impl hash::Hash for ip_mreq { fn hash(&self, state: &mut H) { self.imr_multiaddr.hash(state); @@ -1118,17 +1053,6 @@ cfg_if! { } } impl Eq for sockaddr_in {} - impl fmt::Debug for sockaddr_in { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_in") - .field("sin_len", &self.sin_len) - .field("sin_family", &self.sin_family) - .field("sin_port", &self.sin_port) - .field("sin_addr", &self.sin_addr) - .field("sin_zero", &self.sin_zero) - .finish() - } - } impl hash::Hash for sockaddr_in { fn hash(&self, state: &mut H) { self.sin_len.hash(state); @@ -1153,17 +1077,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_reclen", &self.d_reclen) - .field("d_namlen", &self.d_namlen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -1211,36 +1124,6 @@ cfg_if! { } } impl Eq for statvfs {} - impl fmt::Debug for statvfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statvfs") - .field("f_flag", &self.f_flag) - .field("f_bsize", &self.f_bsize) - .field("f_frsize", &self.f_frsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_bresvd", &self.f_bresvd) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_favail", &self.f_favail) - .field("f_fresvd", &self.f_fresvd) - .field("f_syncreads", &self.f_syncreads) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_fsidx", &self.f_fsidx) - .field("f_fsid", &self.f_fsid) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_spare", &self.f_spare) - .field("f_fstypename", &self.f_fstypename) - // FIXME(debug): .field("f_mntonname", &self.f_mntonname) - // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) - .finish() - } - } impl hash::Hash for statvfs { fn hash(&self, state: &mut H) { self.f_flag.hash(state); @@ -1284,17 +1167,6 @@ cfg_if! { } } impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_pad2", &self.__ss_pad2) - // FIXME(debug): .field("__ss_pad3", &self.__ss_pad3) - .finish() - } - } impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); @@ -1314,16 +1186,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("sigev_notify_attributes", &self.sigev_notify_attributes) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index bd18311f5d20b..3b3971692fe38 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -773,19 +773,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_fileno", &self.d_fileno) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - .field("d_namlen", &self.d_namlen) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_fileno.hash(state); @@ -805,15 +792,6 @@ cfg_if! { impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .finish() - } - } - impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); @@ -832,17 +810,6 @@ cfg_if! { impl Eq for siginfo_t {} - impl fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("siginfo_t") - .field("si_signo", &self.si_signo) - .field("si_code", &self.si_code) - .field("si_errno", &self.si_errno) - .field("si_addr", &self.si_addr) - .finish() - } - } - impl hash::Hash for siginfo_t { fn hash(&self, state: &mut H) { self.si_signo.hash(state); @@ -870,16 +837,6 @@ cfg_if! { impl Eq for lastlog {} - impl fmt::Debug for lastlog { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("lastlog") - .field("ll_time", &self.ll_time) - // FIXME(debug): .field("ll_line", &self.ll_line) - // FIXME(debug): .field("ll_host", &self.ll_host) - .finish() - } - } - impl hash::Hash for lastlog { fn hash(&self, state: &mut H) { self.ll_time.hash(state); @@ -911,17 +868,6 @@ cfg_if! { impl Eq for utmp {} - impl fmt::Debug for utmp { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmp") - // FIXME(debug): .field("ut_line", &self.ut_line) - // FIXME(debug): .field("ut_name", &self.ut_name) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_time", &self.ut_time) - .finish() - } - } - impl hash::Hash for utmp { fn hash(&self, state: &mut H) { self.ut_line.hash(state); @@ -1029,35 +975,6 @@ cfg_if! { impl Eq for statfs {} - impl fmt::Debug for statfs { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("statfs") - .field("f_flags", &self.f_flags) - .field("f_bsize", &self.f_bsize) - .field("f_iosize", &self.f_iosize) - .field("f_blocks", &self.f_blocks) - .field("f_bfree", &self.f_bfree) - .field("f_bavail", &self.f_bavail) - .field("f_files", &self.f_files) - .field("f_ffree", &self.f_ffree) - .field("f_favail", &self.f_favail) - .field("f_syncwrites", &self.f_syncwrites) - .field("f_syncreads", &self.f_syncreads) - .field("f_asyncwrites", &self.f_asyncwrites) - .field("f_asyncreads", &self.f_asyncreads) - .field("f_fsid", &self.f_fsid) - .field("f_namemax", &self.f_namemax) - .field("f_owner", &self.f_owner) - .field("f_ctime", &self.f_ctime) - // FIXME(debug): .field("f_fstypename", &self.f_fstypename) - // FIXME(debug): .field("f_mntonname", &self.f_mntonname) - // FIXME(debug): .field("f_mntfromname", &self.f_mntfromname) - // FIXME(debug): .field("f_mntfromspec", &self.f_mntfromspec) - .field("mount_info", &self.mount_info) - .finish() - } - } - impl hash::Hash for statfs { fn hash(&self, state: &mut H) { self.f_flags.hash(state); diff --git a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs index 9003f3588c1b6..33a19f969ac97 100644 --- a/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +++ b/src/unix/bsd/netbsdlike/openbsd/x86_64.rs @@ -81,22 +81,6 @@ cfg_if! { } } impl Eq for fxsave64 {} - impl fmt::Debug for fxsave64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fxsave64") - .field("fx_fcw", &{ self.fx_fcw }) - .field("fx_fsw", &{ self.fx_fsw }) - .field("fx_ftw", &{ self.fx_ftw }) - .field("fx_fop", &{ self.fx_fop }) - .field("fx_rip", &{ self.fx_rip }) - .field("fx_rdp", &{ self.fx_rdp }) - .field("fx_mxcsr", &{ self.fx_mxcsr }) - .field("fx_mxcsr_mask", &{ self.fx_mxcsr_mask }) - // FIXME(debug): .field("fx_st", &{self.fx_st}) - // FIXME(debug): .field("fx_xmm", &{self.fx_xmm}) - .finish() - } - } impl hash::Hash for fxsave64 { fn hash(&self, state: &mut H) { { self.fx_fcw }.hash(state); diff --git a/src/unix/cygwin/mod.rs b/src/unix/cygwin/mod.rs index c2fda6768b2b0..2986c7c74a7c4 100644 --- a/src/unix/cygwin/mod.rs +++ b/src/unix/cygwin/mod.rs @@ -583,19 +583,6 @@ cfg_if! { impl Eq for siginfo_t {} - impl fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("siginfo_t") - .field("si_signo", &self.si_signo) - .field("si_code", &self.si_code) - .field("si_pid", &self.si_pid) - .field("si_uid", &self.si_uid) - .field("si_errno", &self.si_errno) - // Ignore __pad - .finish() - } - } - impl hash::Hash for siginfo_t { fn hash(&self, state: &mut H) { self.si_signo.hash(state); @@ -607,24 +594,6 @@ cfg_if! { } } - impl fmt::Debug for ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } - - impl fmt::Debug for ifconf { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifconf") - .field("ifc_len", &self.ifc_len) - .field("ifc_ifcu", &self.ifc_ifcu) - .finish() - } - } - impl PartialEq for dirent { fn eq(&self, other: &dirent) -> bool { self.d_ino == other.d_ino @@ -639,16 +608,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_type", &self.d_type) - // FIXME: .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -670,15 +629,6 @@ cfg_if! { impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_family", &self.sun_family) - // FIXME: .field("sun_path", &self.sun_path) - .finish() - } - } - impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_family.hash(state); @@ -722,19 +672,6 @@ cfg_if! { impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME: .field("sysname", &self.sysname) - // FIXME: .field("nodename", &self.nodename) - // FIXME: .field("release", &self.release) - // FIXME: .field("version", &self.version) - // FIXME: .field("machine", &self.machine) - // FIXME: .field("domainname", &self.domainname) - .finish() - } - } - impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index a47aac2a4fa4d..6b168a470bb02 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -517,22 +517,6 @@ cfg_if! { } impl Eq for utmpx {} - - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_type", &self.ut_type) - .field("ut_tv", &self.ut_tv) - .field("ut_id", &self.ut_id) - .field("ut_pid", &self.ut_pid) - .field("ut_user", &self.ut_user) - .field("ut_line", &self.ut_line) - .field("ut_host", &self.ut_host) - .field("__ut_reserved", &self.__ut_reserved) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_type.hash(state); @@ -557,15 +541,6 @@ cfg_if! { } } impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_len", &self.sun_len) - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_len.hash(state); @@ -592,17 +567,6 @@ cfg_if! { } } impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_pad2", &self.__ss_pad2) - // FIXME(debug): .field("__ss_pad3", &self.__ss_pad3) - .finish() - } - } impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); @@ -628,18 +592,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_dev", &self.d_dev) - .field("d_pdev", &self.d_pdev) - .field("d_ino", &self.d_ino) - .field("d_pino", &self.d_pino) - .field("d_reclen", &self.d_reclen) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_dev.hash(state); @@ -660,16 +612,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("sigev_notify_attributes", &self.sigev_notify_attributes) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs index d373a9ced0866..a5a5e53491556 100644 --- a/src/unix/haiku/native.rs +++ b/src/unix/haiku/native.rs @@ -520,15 +520,6 @@ cfg_if! { } impl Eq for cpu_topology_node_info {} - impl fmt::Debug for cpu_topology_node_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("cpu_topology_node_info") - .field("id", &self.id) - .field("type", &self.type_) - .field("level", &self.level) - .finish() - } - } } } diff --git a/src/unix/haiku/x86_64.rs b/src/unix/haiku/x86_64.rs index 548c8e06b825c..16e2612ed760d 100644 --- a/src/unix/haiku/x86_64.rs +++ b/src/unix/haiku/x86_64.rs @@ -83,23 +83,6 @@ cfg_if! { } } impl Eq for fpu_state {} - impl fmt::Debug for fpu_state { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpu_state") - .field("control", &self.control) - .field("status", &self.status) - .field("tag", &self.tag) - .field("opcode", &self.opcode) - .field("rip", &self.rip) - .field("rdp", &self.rdp) - .field("mxcsr", &self.mxcsr) - .field("mscsr_mask", &self.mscsr_mask) - // FIXME(debug): .field("_fpreg", &self._fpreg) - // FIXME(debug): .field("_xmm", &self._xmm) - // FIXME(debug): .field("_reserved_416_511", &self._reserved_416_511) - .finish() - } - } impl hash::Hash for fpu_state { fn hash(&self, state: &mut H) { self.control.hash(state); @@ -128,15 +111,6 @@ cfg_if! { } } impl Eq for xstate_hdr {} - impl fmt::Debug for xstate_hdr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("xstate_hdr") - .field("bv", &self.bv) - .field("xcomp_bv", &self.xcomp_bv) - // FIXME(debug): .field("_reserved", &field._reserved) - .finish() - } - } impl hash::Hash for xstate_hdr { fn hash(&self, state: &mut H) { self.bv.hash(state); @@ -157,15 +131,6 @@ cfg_if! { } } impl Eq for savefpu {} - impl fmt::Debug for savefpu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("savefpu") - .field("fp_fxsave", &self.fp_fxsave) - .field("fp_xstate", &self.fp_xstate) - // FIXME(debug): .field("_fp_ymm", &field._fp_ymm) - .finish() - } - } impl hash::Hash for savefpu { fn hash(&self, state: &mut H) { self.fp_fxsave.hash(state); @@ -198,31 +163,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("rax", &self.rax) - .field("rbx", &self.rbx) - .field("rcx", &self.rcx) - .field("rdx", &self.rdx) - .field("rdi", &self.rdi) - .field("rsi", &self.rsi) - .field("rbp", &self.rbp) - .field("r8", &self.r8) - .field("r9", &self.r9) - .field("r10", &self.r10) - .field("r11", &self.r11) - .field("r12", &self.r12) - .field("r13", &self.r13) - .field("r14", &self.r14) - .field("r15", &self.r15) - .field("rsp", &self.rsp) - .field("rip", &self.rip) - .field("rflags", &self.rflags) - .field("fpu", &self.fpu) - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.rax.hash(state); @@ -256,16 +196,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_link", &self.uc_link) - .field("uc_sigmask", &self.uc_sigmask) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_link.hash(state); diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index f32975bac4544..49bb076633ea2 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -1084,24 +1084,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_type", &self.ut_type) - .field("ut_pid", &self.ut_pid) - .field("ut_line", &self.ut_line) - .field("ut_id", &self.ut_id) - .field("ut_user", &self.ut_user) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_exit", &self.ut_exit) - .field("ut_session", &self.ut_session) - .field("ut_tv", &self.ut_tv) - .field("ut_addr_v6", &self.ut_addr_v6) - .field("__glibc_reserved", &self.__glibc_reserved) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_type.hash(state); diff --git a/src/unix/linux_like/android/b32/arm.rs b/src/unix/linux_like/android/b32/arm.rs index a6170adc14d3f..b78c8a83623ea 100644 --- a/src/unix/linux_like/android/b32/arm.rs +++ b/src/unix/linux_like/android/b32/arm.rs @@ -65,14 +65,6 @@ cfg_if! { } } impl Eq for __c_anonymous_uc_sigmask_with_padding {} - impl fmt::Debug for __c_anonymous_uc_sigmask_with_padding { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uc_sigmask_with_padding") - .field("uc_sigmask_with_padding", &self.uc_sigmask) - // Ignore padding - .finish() - } - } impl hash::Hash for __c_anonymous_uc_sigmask_with_padding { fn hash(&self, state: &mut H) { self.uc_sigmask.hash(state) @@ -104,22 +96,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field( - "uc_sigmask__c_anonymous_union", - &self.uc_sigmask__c_anonymous_union, - ) - .field("uc_regspace", &&self.uc_regspace[..]) - // Ignore padding field - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs index 42be94d425c72..43e739bd9592b 100644 --- a/src/unix/linux_like/android/b32/mod.rs +++ b/src/unix/linux_like/android/b32/mod.rs @@ -181,18 +181,6 @@ s_no_extra_traits! { } } -cfg_if! { - if #[cfg(feature = "extra_traits")] { - impl fmt::Debug for sigset64_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigset64_t") - .field("__bits", &self.__bits) - .finish() - } - } - } -} - // These constants must be of the same type of sigaction.sa_flags pub const SA_NOCLDSTOP: c_int = 0x00000001; pub const SA_NOCLDWAIT: c_int = 0x00000002; diff --git a/src/unix/linux_like/android/b32/x86/mod.rs b/src/unix/linux_like/android/b32/x86/mod.rs index 2acbe7712eb77..edbfd38552cb5 100644 --- a/src/unix/linux_like/android/b32/x86/mod.rs +++ b/src/unix/linux_like/android/b32/x86/mod.rs @@ -67,14 +67,6 @@ cfg_if! { } } impl Eq for __c_anonymous_uc_sigmask_with_padding {} - impl fmt::Debug for __c_anonymous_uc_sigmask_with_padding { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uc_sigmask_with_padding") - .field("uc_sigmask_with_padding", &self.uc_sigmask) - // Ignore padding - .finish() - } - } impl hash::Hash for __c_anonymous_uc_sigmask_with_padding { fn hash(&self, state: &mut H) { self.uc_sigmask.hash(state) @@ -105,21 +97,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field( - "uc_sigmask__c_anonymous_union", - &self.uc_sigmask__c_anonymous_union, - ) - // Ignore padding field - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs index b507dac7a1227..b23c562cd8b7f 100644 --- a/src/unix/linux_like/android/b64/mod.rs +++ b/src/unix/linux_like/android/b64/mod.rs @@ -155,15 +155,6 @@ cfg_if! { impl Eq for pthread_mutex_t {} - impl fmt::Debug for pthread_mutex_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_mutex_t") - .field("value", &self.value) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } - impl hash::Hash for pthread_mutex_t { fn hash(&self, state: &mut H) { self.value.hash(state); @@ -184,15 +175,6 @@ cfg_if! { impl Eq for pthread_cond_t {} - impl fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_cond_t") - .field("value", &self.value) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } - impl hash::Hash for pthread_cond_t { fn hash(&self, state: &mut H) { self.value.hash(state); @@ -217,19 +199,6 @@ cfg_if! { impl Eq for pthread_rwlock_t {} - impl fmt::Debug for pthread_rwlock_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_rwlock_t") - .field("numLocks", &self.numLocks) - .field("writerThreadId", &self.writerThreadId) - .field("pendingReaders", &self.pendingReaders) - .field("pendingWriters", &self.pendingWriters) - .field("attr", &self.attr) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } - impl hash::Hash for pthread_rwlock_t { fn hash(&self, state: &mut H) { self.numLocks.hash(state); @@ -240,14 +209,6 @@ cfg_if! { self.__reserved.hash(state); } } - - impl fmt::Debug for sigset64_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigset64_t") - .field("__bits", &self.__bits) - .finish() - } - } } } diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs index ce2d70999856a..3288f05e076aa 100644 --- a/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -195,15 +195,6 @@ cfg_if! { } } impl Eq for _libc_fpxreg {} - impl fmt::Debug for _libc_fpxreg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("_libc_fpxreg") - .field("significand", &self.significand) - .field("exponent", &self.exponent) - // Ignore padding field - .finish() - } - } impl hash::Hash for _libc_fpxreg { fn hash(&self, state: &mut H) { self.significand.hash(state); @@ -228,23 +219,6 @@ cfg_if! { } } impl Eq for _libc_fpstate {} - impl fmt::Debug for _libc_fpstate { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("_libc_fpstate") - .field("cwd", &self.cwd) - .field("swd", &self.swd) - .field("ftw", &self.ftw) - .field("fop", &self.fop) - .field("rip", &self.rip) - .field("rdp", &self.rdp) - .field("mxcsr", &self.mxcsr) - .field("mxcr_mask", &self.mxcr_mask) - .field("_st", &self._st) - .field("_xmm", &self._xmm) - // Ignore padding field - .finish() - } - } impl hash::Hash for _libc_fpstate { fn hash(&self, state: &mut H) { self.cwd.hash(state); @@ -268,15 +242,6 @@ cfg_if! { } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("gregs", &self.gregs) - .field("fpregs", &self.fpregs) - // Ignore padding field - .finish() - } - } impl hash::Hash for mcontext_t { fn hash(&self, state: &mut H) { self.gregs.hash(state); @@ -296,18 +261,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask64", &self.uc_sigmask64) - // Ignore padding field - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); @@ -341,24 +294,6 @@ cfg_if! { impl Eq for user_fpregs_struct {} - impl fmt::Debug for user_fpregs_struct { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("user_fpregs_struct") - .field("cwd", &self.cwd) - .field("swd", &self.swd) - .field("ftw", &self.ftw) - .field("fop", &self.fop) - .field("rip", &self.rip) - .field("rdp", &self.rdp) - .field("mxcsr", &self.mxcsr) - .field("mxcr_mask", &self.mxcr_mask) - .field("st_space", &self.st_space) - // FIXME(debug): .field("xmm_space", &self.xmm_space) - // Ignore padding field - .finish() - } - } - impl hash::Hash for user_fpregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 5915d9dcb631c..3dee96e2123a0 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -660,15 +660,6 @@ cfg_if! { } } impl Eq for sockaddr_nl {} - impl fmt::Debug for sockaddr_nl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_nl") - .field("nl_family", &self.nl_family) - .field("nl_pid", &self.nl_pid) - .field("nl_groups", &self.nl_groups) - .finish() - } - } impl hash::Hash for sockaddr_nl { fn hash(&self, state: &mut H) { self.nl_family.hash(state); @@ -693,18 +684,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -731,18 +710,6 @@ cfg_if! { impl Eq for dirent64 {} - impl fmt::Debug for dirent64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent64") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent64 { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -765,18 +732,6 @@ cfg_if! { impl Eq for siginfo_t {} - impl fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("siginfo_t") - .field("si_signo", &self.si_signo) - .field("si_errno", &self.si_errno) - .field("si_code", &self.si_code) - // Ignore _pad - // Ignore _align - .finish() - } - } - impl hash::Hash for siginfo_t { fn hash(&self, state: &mut H) { self.si_signo.hash(state); @@ -805,16 +760,6 @@ cfg_if! { impl Eq for lastlog {} - impl fmt::Debug for lastlog { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("lastlog") - .field("ll_time", &self.ll_time) - .field("ll_line", &self.ll_line) - // FIXME(debug): .field("ll_host", &self.ll_host) - .finish() - } - } - impl hash::Hash for lastlog { fn hash(&self, state: &mut H) { self.ll_time.hash(state); @@ -853,24 +798,6 @@ cfg_if! { impl Eq for utmp {} - impl fmt::Debug for utmp { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmp") - .field("ut_type", &self.ut_type) - .field("ut_pid", &self.ut_pid) - .field("ut_line", &self.ut_line) - .field("ut_id", &self.ut_id) - .field("ut_user", &self.ut_user) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_exit", &self.ut_exit) - .field("ut_session", &self.ut_session) - .field("ut_tv", &self.ut_tv) - .field("ut_addr_v6", &self.ut_addr_v6) - .field("unused", &self.unused) - .finish() - } - } - impl hash::Hash for utmp { fn hash(&self, state: &mut H) { self.ut_type.hash(state); @@ -907,18 +834,6 @@ cfg_if! { impl Eq for sockaddr_alg {} - impl fmt::Debug for sockaddr_alg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_alg") - .field("salg_family", &self.salg_family) - .field("salg_type", &self.salg_type) - .field("salg_feat", &self.salg_feat) - .field("salg_mask", &self.salg_mask) - .field("salg_name", &&self.salg_name[..]) - .finish() - } - } - impl hash::Hash for sockaddr_alg { fn hash(&self, state: &mut H) { self.salg_family.hash(state); @@ -938,16 +853,6 @@ cfg_if! { } impl Eq for uinput_setup {} - impl fmt::Debug for uinput_setup { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uinput_setup") - .field("id", &self.id) - .field("name", &&self.name[..]) - .field("ff_effects_max", &self.ff_effects_max) - .finish() - } - } - impl hash::Hash for uinput_setup { fn hash(&self, state: &mut H) { self.id.hash(state); @@ -969,20 +874,6 @@ cfg_if! { } impl Eq for uinput_user_dev {} - impl fmt::Debug for uinput_user_dev { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uinput_setup") - .field("name", &&self.name[..]) - .field("id", &self.id) - .field("ff_effects_max", &self.ff_effects_max) - .field("absmax", &&self.absmax[..]) - .field("absmin", &&self.absmin[..]) - .field("absfuzz", &&self.absfuzz[..]) - .field("absflat", &&self.absflat[..]) - .finish() - } - } - impl hash::Hash for uinput_user_dev { fn hash(&self, state: &mut H) { self.name.hash(state); @@ -995,24 +886,6 @@ cfg_if! { } } - impl fmt::Debug for ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } - - impl fmt::Debug for ifconf { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifconf") - .field("ifc_len", &self.ifc_len) - .field("ifc_ifcu", &self.ifc_ifcu) - .finish() - } - } - #[allow(deprecated)] impl af_alg_iv { fn as_slice(&self) -> &[u8] { @@ -1030,15 +903,6 @@ cfg_if! { #[allow(deprecated)] impl Eq for af_alg_iv {} - #[allow(deprecated)] - impl fmt::Debug for af_alg_iv { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("af_alg_iv") - .field("ivlen", &self.ivlen) - .finish() - } - } - #[allow(deprecated)] impl hash::Hash for af_alg_iv { fn hash(&self, state: &mut H) { @@ -1054,15 +918,6 @@ cfg_if! { } } impl Eq for prop_info {} - impl fmt::Debug for prop_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("prop_info") - .field("__name", &self.__name) - .field("__serial", &self.__serial) - .field("__value", &self.__value) - .finish() - } - } } } diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 46d0d0f007433..deac314ce35c8 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -403,17 +403,6 @@ cfg_if! { } } impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -447,26 +436,6 @@ cfg_if! { } } impl Eq for sysinfo {} - impl fmt::Debug for sysinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sysinfo") - .field("uptime", &self.uptime) - .field("loads", &self.loads) - .field("totalram", &self.totalram) - .field("freeram", &self.freeram) - .field("sharedram", &self.sharedram) - .field("bufferram", &self.bufferram) - .field("totalswap", &self.totalswap) - .field("freeswap", &self.freeswap) - .field("procs", &self.procs) - .field("pad", &self.pad) - .field("totalhigh", &self.totalhigh) - .field("freehigh", &self.freehigh) - .field("mem_unit", &self.mem_unit) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } impl hash::Hash for sysinfo { fn hash(&self, state: &mut H) { self.uptime.hash(state); @@ -495,16 +464,6 @@ cfg_if! { } } impl Eq for mq_attr {} - impl fmt::Debug for mq_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mq_attr") - .field("mq_flags", &self.mq_flags) - .field("mq_maxmsg", &self.mq_maxmsg) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_curmsgs", &self.mq_curmsgs) - .finish() - } - } impl hash::Hash for mq_attr { fn hash(&self, state: &mut H) { self.mq_flags.hash(state); @@ -520,13 +479,6 @@ cfg_if! { } } impl Eq for pthread_cond_t {} - impl fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_cond_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } impl hash::Hash for pthread_cond_t { fn hash(&self, state: &mut H) { self.size.hash(state); diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 33d3cfbd6b436..465ceddeab64e 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -40,8 +40,6 @@ pub const SO_PASSCRED: c_int = 16; pub const SO_PEERCRED: c_int = 17; pub const SO_RCVLOWAT: c_int = 18; pub const SO_SNDLOWAT: c_int = 19; -const SO_RCVTIMEO_OLD: c_int = 20; -const SO_SNDTIMEO_OLD: c_int = 21; pub const SO_SECURITY_AUTHENTICATION: c_int = 22; pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 23; pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 24; @@ -50,9 +48,6 @@ pub const SO_ATTACH_FILTER: c_int = 26; pub const SO_DETACH_FILTER: c_int = 27; pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; pub const SO_PEERNAME: c_int = 28; -const SO_TIMESTAMP_OLD: c_int = 29; -const SO_TIMESTAMPNS_OLD: c_int = 35; -const SO_TIMESTAMPING_OLD: c_int = 37; cfg_if! { if #[cfg(all( @@ -76,6 +71,12 @@ cfg_if! { pub const SO_RCVTIMEO: c_int = 66; pub const SO_SNDTIMEO: c_int = 67; } else { + const SO_TIMESTAMP_OLD: c_int = 29; + const SO_TIMESTAMPNS_OLD: c_int = 35; + const SO_TIMESTAMPING_OLD: c_int = 37; + const SO_RCVTIMEO_OLD: c_int = 20; + const SO_SNDTIMEO_OLD: c_int = 21; + pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD; pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD; pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD; diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index bf58d5a145b82..ba688948a906d 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -33,16 +33,17 @@ pub const SO_SNDBUF: c_int = 0x1001; pub const SO_RCVBUF: c_int = 0x1002; pub const SO_SNDLOWAT: c_int = 0x1003; pub const SO_RCVLOWAT: c_int = 0x1004; -// NOTE: These definitions are now being renamed with _OLD postfix, -// but CI haven't support them yet. -// Some related consts could be found in b32.rs and b64.rs -const SO_SNDTIMEO_OLD: c_int = 0x1005; -const SO_RCVTIMEO_OLD: c_int = 0x1006; cfg_if! { if #[cfg(linux_time_bits64)] { + const SO_RCVTIMEO_NEW: c_int = 66; + const SO_SNDTIMEO_NEW: c_int = 67; + pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW; pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW; } else { + const SO_SNDTIMEO_OLD: c_int = 0x1005; + const SO_RCVTIMEO_OLD: c_int = 0x1006; + pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_OLD; pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_OLD; } @@ -95,28 +96,27 @@ pub const SO_ZEROCOPY: c_int = 60; pub const SO_TXTIME: c_int = 61; pub const SCM_TXTIME: c_int = SO_TXTIME; pub const SO_BINDTOIFINDEX: c_int = 62; -// NOTE: These definitions are now being renamed with _OLD postfix, -// but CI haven't support them yet. -// Some related consts could be found in b32.rs and b64.rs -const SO_TIMESTAMP_OLD: c_int = 29; -const SO_RCVTIMEO_NEW: c_int = 66; -const SO_SNDTIMEO_NEW: c_int = 67; -const SO_TIMESTAMPNS_OLD: c_int = 35; -const SO_TIMESTAMPING_OLD: c_int = 37; -const SO_TIMESTAMP_NEW: c_int = 63; -const SO_TIMESTAMPNS_NEW: c_int = 64; -const SO_TIMESTAMPING_NEW: c_int = 65; + cfg_if! { if #[cfg(linux_time_bits64)] { + const SO_TIMESTAMP_NEW: c_int = 63; + const SO_TIMESTAMPNS_NEW: c_int = 64; + const SO_TIMESTAMPING_NEW: c_int = 65; + pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW; pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW; pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW; } else { + const SO_TIMESTAMP_OLD: c_int = 29; + const SO_TIMESTAMPNS_OLD: c_int = 35; + const SO_TIMESTAMPING_OLD: c_int = 37; + pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD; pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD; pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD; } } + // pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; pub const SO_PREFER_BUSY_POLL: c_int = 69; pub const SO_BUSY_POLL_BUDGET: c_int = 70; diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index 33a373ce1fa2f..3249a9f1b6a46 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -24,17 +24,23 @@ pub const SO_REUSEPORT: c_int = 15; // powerpc only differs in these pub const SO_RCVLOWAT: c_int = 16; pub const SO_SNDLOWAT: c_int = 17; + cfg_if! { if #[cfg(linux_time_bits64)] { - pub const SO_SNDTIMEO: c_int = 67; - pub const SO_RCVTIMEO: c_int = 66; + const SO_RCVTIMEO_NEW: c_int = 66; + const SO_SNDTIMEO_NEW: c_int = 67; + + pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW; + pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW; } else { - pub const SO_SNDTIMEO: c_int = 19; - pub const SO_RCVTIMEO: c_int = 18; + const SO_RCVTIMEO_OLD: c_int = 18; + const SO_SNDTIMEO_OLD: c_int = 19; + + pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_OLD; + pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_OLD; } } -// pub const SO_RCVTIMEO_OLD: c_int = 18; -// pub const SO_SNDTIMEO_OLD: c_int = 19; + pub const SO_PASSCRED: c_int = 20; pub const SO_PEERCRED: c_int = 21; // end @@ -48,18 +54,23 @@ pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; pub const SO_PEERNAME: c_int = 28; cfg_if! { if #[cfg(linux_time_bits64)] { + const SO_TIMESTAMP_NEW: c_int = 63; + const SO_TIMESTAMPNS_NEW: c_int = 64; + const SO_TIMESTAMPING_NEW: c_int = 65; + pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW; pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW; pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW; } else { + const SO_TIMESTAMP_OLD: c_int = 29; + const SO_TIMESTAMPNS_OLD: c_int = 35; + const SO_TIMESTAMPING_OLD: c_int = 37; + pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD; pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD; pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD; } } -const SO_TIMESTAMP_OLD: c_int = 29; -const SO_TIMESTAMPNS_OLD: c_int = 35; -const SO_TIMESTAMPING_OLD: c_int = 37; pub const SO_ACCEPTCONN: c_int = 30; pub const SO_PEERSEC: c_int = 31; pub const SO_SNDBUFFORCE: c_int = 32; @@ -94,11 +105,6 @@ pub const SO_ZEROCOPY: c_int = 60; pub const SO_TXTIME: c_int = 61; pub const SCM_TXTIME: c_int = SO_TXTIME; pub const SO_BINDTOIFINDEX: c_int = 62; -const SO_TIMESTAMP_NEW: c_int = 63; -const SO_TIMESTAMPNS_NEW: c_int = 64; -const SO_TIMESTAMPING_NEW: c_int = 65; -const SO_RCVTIMEO_NEW: c_int = 66; -const SO_SNDTIMEO_NEW: c_int = 67; // pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; pub const SO_PREFER_BUSY_POLL: c_int = 69; pub const SO_BUSY_POLL_BUDGET: c_int = 70; diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs index 2dd4a88674f3e..80d7be3891f3a 100644 --- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -60,23 +60,35 @@ s! { pub struct stat64 { pub st_dev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad1: c_uint, + #[cfg(not(gnu_time_bits64))] __st_ino: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_ino: crate::ino_t, pub st_mode: crate::mode_t, pub st_nlink: crate::nlink_t, pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_uint, pub st_size: off64_t, pub st_blksize: crate::blksize_t, pub st_blocks: crate::blkcnt64_t, pub st_atime: crate::time_t, pub st_atime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_mtime: crate::time_t, pub st_mtime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_ctime: crate::time_t, pub st_ctime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, + #[cfg(not(gnu_time_bits64))] pub st_ino: crate::ino64_t, } @@ -115,10 +127,13 @@ s! { pub shm_perm: crate::ipc_perm, pub shm_segsz: size_t, pub shm_atime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused1: c_ulong, pub shm_dtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused2: c_ulong, pub shm_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused3: c_ulong, pub shm_cpid: crate::pid_t, pub shm_lpid: crate::pid_t, @@ -130,10 +145,13 @@ s! { pub struct msqid_ds { pub msg_perm: crate::ipc_perm, pub msg_stime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved1: c_ulong, pub msg_rtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved2: c_ulong, pub msg_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved3: c_ulong, pub __msg_cbytes: c_ulong, pub msg_qnum: crate::msgqnum_t, @@ -242,17 +260,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_link) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs index 649a8e04bd470..6581d729e9923 100644 --- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -5,8 +5,12 @@ pub type wchar_t = i32; s! { pub struct stat { + #[cfg(not(gnu_time_bits64))] pub st_dev: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_dev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] st_pad1: [c_long; 3], pub st_ino: crate::ino_t, @@ -16,11 +20,14 @@ s! { pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, + #[cfg(not(gnu_time_bits64))] pub st_rdev: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_rdev: crate::dev_t, #[cfg(not(gnu_file_offset_bits64))] st_pad2: [c_long; 2], - #[cfg(gnu_file_offset_bits64)] + #[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))] st_pad2: [c_long; 3], pub st_size: off_t, @@ -28,40 +35,84 @@ s! { #[cfg(not(gnu_file_offset_bits64))] st_pad3: c_long, + #[cfg(gnu_time_bits64)] + pub st_blksize: crate::blksize_t, + #[cfg(gnu_time_bits64)] + pub st_blocks: crate::blkcnt_t, + pub st_atime: crate::time_t, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_atime_nsec: c_long, pub st_mtime: crate::time_t, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_mtime_nsec: c_long, pub st_ctime: crate::time_t, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, pub st_ctime_nsec: c_long, + #[cfg(not(gnu_time_bits64))] pub st_blksize: crate::blksize_t, - #[cfg(gnu_file_offset_bits64)] + #[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))] st_pad4: c_long, + #[cfg(not(gnu_time_bits64))] pub st_blocks: crate::blkcnt_t, + #[cfg(not(gnu_time_bits64))] st_pad5: [c_long; 14], } pub struct stat64 { + #[cfg(not(gnu_time_bits64))] pub st_dev: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_dev: crate::dev_t, + + #[cfg(not(gnu_time_bits64))] st_pad1: [c_long; 3], + pub st_ino: crate::ino64_t, pub st_mode: crate::mode_t, pub st_nlink: crate::nlink_t, pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, + + #[cfg(not(gnu_time_bits64))] pub st_rdev: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_rdev: crate::dev_t, + + #[cfg(not(gnu_time_bits64))] st_pad2: [c_long; 3], + pub st_size: off64_t, + + #[cfg(gnu_time_bits64)] + pub st_blksize: crate::blksize_t, + #[cfg(gnu_time_bits64)] + pub st_blocks: crate::blkcnt_t, + pub st_atime: crate::time_t, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_atime_nsec: c_long, pub st_mtime: crate::time_t, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_mtime_nsec: c_long, pub st_ctime: crate::time_t, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, pub st_ctime_nsec: c_long, + + #[cfg(not(gnu_time_bits64))] pub st_blksize: crate::blksize_t, + #[cfg(not(gnu_time_bits64))] st_pad3: c_long, + #[cfg(not(gnu_time_bits64))] pub st_blocks: crate::blkcnt64_t, + #[cfg(not(gnu_time_bits64))] st_pad5: [c_long; 14], } @@ -161,22 +212,22 @@ s! { pub struct msqid_ds { pub msg_perm: crate::ipc_perm, - #[cfg(target_endian = "big")] + #[cfg(all(not(gnu_time_bits64), target_endian = "big"))] __glibc_reserved1: c_ulong, pub msg_stime: crate::time_t, - #[cfg(target_endian = "little")] + #[cfg(all(not(gnu_time_bits64), target_endian = "little"))] __glibc_reserved1: c_ulong, - #[cfg(target_endian = "big")] + #[cfg(all(not(gnu_time_bits64), target_endian = "big"))] __glibc_reserved2: c_ulong, pub msg_rtime: crate::time_t, - #[cfg(target_endian = "little")] + #[cfg(all(not(gnu_time_bits64), target_endian = "little"))] __glibc_reserved2: c_ulong, - #[cfg(target_endian = "big")] + #[cfg(all(not(gnu_time_bits64), target_endian = "big"))] __glibc_reserved3: c_ulong, pub msg_ctime: crate::time_t, #[cfg(target_endian = "little")] __glibc_reserved3: c_ulong, - pub __msg_cbytes: c_ulong, + __msg_cbytes: c_ulong, pub msg_qnum: crate::msgqnum_t, pub msg_qbytes: crate::msglen_t, pub msg_lspid: crate::pid_t, diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs index e9a958478c543..fe843a7643207 100644 --- a/src/unix/linux_like/linux/gnu/b32/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/mod.rs @@ -15,6 +15,7 @@ pub type __fsword_t = i32; pub type fsblkcnt64_t = u64; pub type fsfilcnt64_t = u64; pub type __syscall_ulong_t = c_ulong; +pub type __suseconds64_t = i64; cfg_if! { if #[cfg(target_arch = "riscv32")] { @@ -29,6 +30,18 @@ cfg_if! { pub type fsfilcnt_t = u64; pub type rlim_t = u64; pub type blksize_t = i64; + } else if #[cfg(gnu_time_bits64)] { + pub type time_t = i64; + pub type suseconds_t = i32; + type __ino_t = c_ulong; + type __ino64_t = u64; + pub type ino_t = __ino64_t; + pub type off_t = i64; + pub type blkcnt_t = i64; + pub type fsblkcnt_t = u64; + pub type fsfilcnt_t = u64; + pub type rlim_t = u64; + pub type blksize_t = i32; } else if #[cfg(gnu_file_offset_bits64)] { pub type time_t = i32; pub type suseconds_t = i32; @@ -67,11 +80,12 @@ cfg_if! { pub struct stat { pub st_dev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad1: c_uint, - #[cfg(not(gnu_file_offset_bits64))] + #[cfg(any(gnu_time_bits64, not(gnu_file_offset_bits64)))] pub st_ino: crate::ino_t, - #[cfg(all(gnu_file_offset_bits64))] + #[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))] __st_ino: __ino_t, pub st_mode: crate::mode_t, @@ -81,6 +95,7 @@ cfg_if! { pub st_rdev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_uint, pub st_size: off_t, @@ -90,16 +105,22 @@ cfg_if! { pub st_atime: crate::time_t, pub st_atime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_mtime: crate::time_t, pub st_mtime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_ctime: crate::time_t, pub st_ctime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, #[cfg(not(gnu_file_offset_bits64))] __glibc_reserved4: c_long, #[cfg(not(gnu_file_offset_bits64))] __glibc_reserved5: c_long, - #[cfg(gnu_file_offset_bits64)] + #[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))] pub st_ino: crate::ino_t, } } @@ -154,28 +175,114 @@ s! { pub struct semid_ds { pub sem_perm: ipc_perm, - #[cfg(target_arch = "powerpc")] + #[cfg(all(not(gnu_time_bits64), target_arch = "powerpc"))] __reserved: crate::__syscall_ulong_t, pub sem_otime: crate::time_t, #[cfg(not(any( + gnu_time_bits64, target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc" )))] __reserved: crate::__syscall_ulong_t, - #[cfg(target_arch = "powerpc")] + #[cfg(all(not(gnu_time_bits64), target_arch = "powerpc"))] __reserved2: crate::__syscall_ulong_t, pub sem_ctime: crate::time_t, #[cfg(not(any( + gnu_time_bits64, target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc" )))] __reserved2: crate::__syscall_ulong_t, pub sem_nsems: crate::__syscall_ulong_t, + #[cfg(all( + gnu_time_bits64, + not(any( + target_arch = "mips", + target_arch = "mips32r6", + target_arch = "powerpc", + target_arch = "arm", + target_arch = "x86" + )) + ))] + __reserved2: crate::__syscall_ulong_t, __glibc_reserved3: crate::__syscall_ulong_t, __glibc_reserved4: crate::__syscall_ulong_t, } + + #[cfg(gnu_time_bits64)] + pub struct timex { + pub modes: c_uint, + _pad1: c_int, + pub offset: c_longlong, + pub freq: c_longlong, + pub maxerror: c_longlong, + pub esterror: c_longlong, + pub status: c_int, + _pad2: c_int, + pub constant: c_longlong, + pub precision: c_longlong, + pub tolerance: c_longlong, + pub time: crate::timeval, + pub tick: c_longlong, + pub ppsfreq: c_longlong, + pub jitter: c_longlong, + pub shift: c_int, + _pad3: c_int, + pub stabil: c_longlong, + pub jitcnt: c_longlong, + pub calcnt: c_longlong, + pub errcnt: c_longlong, + pub stbcnt: c_longlong, + pub tai: c_int, + pub __unused1: i32, + pub __unused2: i32, + pub __unused3: i32, + pub __unused4: i32, + pub __unused5: i32, + pub __unused6: i32, + pub __unused7: i32, + pub __unused8: i32, + pub __unused9: i32, + pub __unused10: i32, + pub __unused11: i32, + } + + #[cfg(not(gnu_time_bits64))] + pub struct timex { + pub modes: c_uint, + pub offset: c_long, + pub freq: c_long, + pub maxerror: c_long, + pub esterror: c_long, + pub status: c_int, + pub constant: c_long, + pub precision: c_long, + pub tolerance: c_long, + pub time: crate::timeval, + pub tick: c_long, + pub ppsfreq: c_long, + pub jitter: c_long, + pub shift: c_int, + pub stabil: c_long, + pub jitcnt: c_long, + pub calcnt: c_long, + pub errcnt: c_long, + pub stbcnt: c_long, + pub tai: c_int, + pub __unused1: i32, + pub __unused2: i32, + pub __unused3: i32, + pub __unused4: i32, + pub __unused5: i32, + pub __unused6: i32, + pub __unused7: i32, + pub __unused8: i32, + pub __unused9: i32, + pub __unused10: i32, + pub __unused11: i32, + } } pub const POSIX_FADV_DONTNEED: c_int = 4; diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs index 36da977d688a3..d562aac3700a8 100644 --- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs @@ -67,17 +67,26 @@ s! { pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_ushort, pub st_size: off_t, pub st_blksize: crate::blksize_t, pub st_blocks: crate::blkcnt_t, pub st_atime: crate::time_t, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_atime_nsec: c_long, pub st_mtime: crate::time_t, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_mtime_nsec: c_long, pub st_ctime: crate::time_t, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, pub st_ctime_nsec: c_long, + #[cfg(not(gnu_time_bits64))] __glibc_reserved4: c_ulong, + #[cfg(not(gnu_time_bits64))] __glibc_reserved5: c_ulong, } @@ -89,17 +98,26 @@ s! { pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_ushort, pub st_size: off64_t, pub st_blksize: crate::blksize_t, pub st_blocks: crate::blkcnt64_t, pub st_atime: crate::time_t, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_atime_nsec: c_long, pub st_mtime: crate::time_t, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_mtime_nsec: c_long, pub st_ctime: crate::time_t, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, pub st_ctime_nsec: c_long, + #[cfg(not(gnu_time_bits64))] __glibc_reserved4: c_ulong, + #[cfg(not(gnu_time_bits64))] __glibc_reserved5: c_ulong, } @@ -136,13 +154,20 @@ s! { pub struct shmid_ds { pub shm_perm: crate::ipc_perm, + #[cfg(gnu_time_bits64)] + pub shm_segsz: size_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved1: c_uint, pub shm_atime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved2: c_uint, pub shm_dtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved3: c_uint, pub shm_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved4: c_uint, + #[cfg(not(gnu_time_bits64))] pub shm_segsz: size_t, pub shm_cpid: crate::pid_t, pub shm_lpid: crate::pid_t, @@ -153,10 +178,13 @@ s! { pub struct msqid_ds { pub msg_perm: crate::ipc_perm, + #[cfg(not(gnu_time_bits64))] __glibc_reserved1: c_uint, pub msg_stime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved2: c_uint, pub msg_rtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved3: c_uint, pub msg_ctime: crate::time_t, pub __msg_cbytes: c_ulong, diff --git a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs index 7533ad689bb42..03760e72e5e93 100644 --- a/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs @@ -154,12 +154,18 @@ s! { pub struct shmid_ds { pub shm_perm: crate::ipc_perm, + #[cfg(gnu_time_bits64)] + pub shm_segsz: size_t, + #[cfg(not(gnu_time_bits64))] __pad1: c_uint, pub shm_atime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_uint, pub shm_dtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __pad3: c_uint, pub shm_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] pub shm_segsz: size_t, pub shm_cpid: crate::pid_t, pub shm_lpid: crate::pid_t, @@ -170,19 +176,22 @@ s! { pub struct msqid_ds { pub msg_perm: crate::ipc_perm, + #[cfg(not(gnu_time_bits64))] __pad1: c_uint, pub msg_stime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_uint, pub msg_rtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __pad3: c_uint, pub msg_ctime: crate::time_t, - pub __msg_cbytes: c_ushort, + pub __msg_cbytes: c_ulong, pub msg_qnum: crate::msgqnum_t, pub msg_qbytes: crate::msglen_t, pub msg_lspid: crate::pid_t, pub msg_lrpid: crate::pid_t, - __glibc_reserved1: c_ulong, - __glibc_reserved2: c_ulong, + __glibc_reserved4: c_ulong, + __glibc_reserved5: c_ulong, } } diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs index c0eb9e89bc442..0f23f0033417a 100644 --- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -134,23 +134,35 @@ s! { pub struct stat64 { pub st_dev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad1: c_uint, + #[cfg(not(gnu_time_bits64))] __st_ino: c_ulong, + #[cfg(gnu_time_bits64)] + pub st_ino: crate::ino_t, pub st_mode: crate::mode_t, pub st_nlink: crate::nlink_t, pub st_uid: crate::uid_t, pub st_gid: crate::gid_t, pub st_rdev: crate::dev_t, + #[cfg(not(gnu_time_bits64))] __pad2: c_uint, pub st_size: off64_t, pub st_blksize: crate::blksize_t, pub st_blocks: crate::blkcnt64_t, pub st_atime: crate::time_t, pub st_atime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _atime_pad: c_int, pub st_mtime: crate::time_t, pub st_mtime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _mtime_pad: c_int, pub st_ctime: crate::time_t, pub st_ctime_nsec: c_long, + #[cfg(gnu_time_bits64)] + _ctime_pad: c_int, + #[cfg(not(gnu_time_bits64))] pub st_ino: crate::ino64_t, } @@ -189,10 +201,13 @@ s! { pub shm_perm: crate::ipc_perm, pub shm_segsz: size_t, pub shm_atime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused1: c_ulong, pub shm_dtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused2: c_ulong, pub shm_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __unused3: c_ulong, pub shm_cpid: crate::pid_t, pub shm_lpid: crate::pid_t, @@ -204,10 +219,13 @@ s! { pub struct msqid_ds { pub msg_perm: crate::ipc_perm, pub msg_stime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved1: c_ulong, pub msg_rtime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved2: c_ulong, pub msg_ctime: crate::time_t, + #[cfg(not(gnu_time_bits64))] __glibc_reserved3: c_ulong, pub __msg_cbytes: c_ulong, pub msg_qnum: crate::msgqnum_t, @@ -296,26 +314,6 @@ cfg_if! { impl Eq for user_fpxregs_struct {} - impl fmt::Debug for user_fpxregs_struct { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("user_fpxregs_struct") - .field("cwd", &self.cwd) - .field("swd", &self.swd) - .field("twd", &self.twd) - .field("fop", &self.fop) - .field("fip", &self.fip) - .field("fcs", &self.fcs) - .field("foo", &self.foo) - .field("fos", &self.fos) - .field("mxcsr", &self.mxcsr) - // Ignore __reserved field - .field("st_space", &self.st_space) - .field("xmm_space", &self.xmm_space) - // Ignore padding field - .finish() - } - } - impl hash::Hash for user_fpxregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); @@ -347,19 +345,6 @@ cfg_if! { impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - // Ignore __private field - .finish() - } - } - impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/gnu/b64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mod.rs index 5927e6c991725..ba5678b459795 100644 --- a/src/unix/linux_like/linux/gnu/b64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mod.rs @@ -97,6 +97,85 @@ s! { __glibc_reserved3: crate::__syscall_ulong_t, __glibc_reserved4: crate::__syscall_ulong_t, } + + pub struct timex { + pub modes: c_uint, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub offset: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub offset: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub freq: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub freq: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub maxerror: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub maxerror: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub esterror: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub esterror: c_long, + pub status: c_int, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub constant: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub constant: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub precision: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub precision: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tolerance: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tolerance: c_long, + pub time: crate::timeval, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tick: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tick: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub ppsfreq: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub ppsfreq: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub jitter: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub jitter: c_long, + pub shift: c_int, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub stabil: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub stabil: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub jitcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub jitcnt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub calcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub calcnt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub errcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub errcnt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub stbcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub stbcnt: c_long, + pub tai: c_int, + pub __unused1: i32, + pub __unused2: i32, + pub __unused3: i32, + pub __unused4: i32, + pub __unused5: i32, + pub __unused6: i32, + pub __unused7: i32, + pub __unused8: i32, + pub __unused9: i32, + pub __unused10: i32, + pub __unused11: i32, + } } pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs index 18684de36dc52..aa42a025db351 100644 --- a/src/unix/linux_like/linux/gnu/b64/s390x.rs +++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -227,12 +227,6 @@ cfg_if! { impl Eq for fpreg_t {} - impl fmt::Debug for fpreg_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpreg_t").field("d", &self.d).finish() - } - } - impl hash::Hash for fpreg_t { fn hash(&self, state: &mut H) { let d: u64 = self.d.to_bits(); diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 9bcc2717c7bd1..e76ae75125d17 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -346,23 +346,6 @@ cfg_if! { impl Eq for user_fpregs_struct {} - impl fmt::Debug for user_fpregs_struct { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("user_fpregs_struct") - .field("cwd", &self.cwd) - .field("ftw", &self.ftw) - .field("fop", &self.fop) - .field("rip", &self.rip) - .field("rdp", &self.rdp) - .field("mxcsr", &self.mxcsr) - .field("mxcr_mask", &self.mxcr_mask) - .field("st_space", &self.st_space) - // FIXME(debug): .field("xmm_space", &self.xmm_space) - // Ignore padding field - .finish() - } - } - impl hash::Hash for user_fpregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); @@ -391,19 +374,6 @@ cfg_if! { impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - // Ignore __private field - .finish() - } - } - impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 5235bce1f4796..4fc9a0aa2068b 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -174,85 +174,6 @@ s! { pub rt_irtt: c_ushort, } - pub struct timex { - pub modes: c_uint, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub offset: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub offset: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub freq: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub freq: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub maxerror: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub maxerror: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub esterror: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub esterror: c_long, - pub status: c_int, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub constant: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub constant: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub precision: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub precision: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub tolerance: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub tolerance: c_long, - pub time: crate::timeval, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub tick: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub tick: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub ppsfreq: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub ppsfreq: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub jitter: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub jitter: c_long, - pub shift: c_int, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub stabil: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub stabil: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub jitcnt: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub jitcnt: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub calcnt: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub calcnt: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub errcnt: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub errcnt: c_long, - #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] - pub stbcnt: i64, - #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] - pub stbcnt: c_long, - pub tai: c_int, - pub __unused1: i32, - pub __unused2: i32, - pub __unused3: i32, - pub __unused4: i32, - pub __unused5: i32, - pub __unused6: i32, - pub __unused7: i32, - pub __unused8: i32, - pub __unused9: i32, - pub __unused10: i32, - pub __unused11: i32, - } - pub struct ntptimeval { pub time: crate::timeval, pub maxerror: c_long, @@ -436,6 +357,18 @@ s! { __pos: off64_t, __state: crate::mbstate_t, } + + // linux x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 + pub struct timespec { + pub tv_sec: time_t, + #[cfg(all(gnu_time_bits64, target_endian = "big"))] + __pad: i32, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tv_nsec: c_long, + #[cfg(all(gnu_time_bits64, target_endian = "little"))] + __pad: i32, + } } impl siginfo_t { @@ -522,19 +455,13 @@ impl siginfo_t { } } -pub union __c_anonymous_ptrace_syscall_info_data { - pub entry: __c_anonymous_ptrace_syscall_info_entry, - pub exit: __c_anonymous_ptrace_syscall_info_exit, - pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp, -} -impl Copy for __c_anonymous_ptrace_syscall_info_data {} -impl Clone for __c_anonymous_ptrace_syscall_info_data { - fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data { - *self +s_no_extra_traits! { + pub union __c_anonymous_ptrace_syscall_info_data { + pub entry: __c_anonymous_ptrace_syscall_info_entry, + pub exit: __c_anonymous_ptrace_syscall_info_exit, + pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp, } -} -s_no_extra_traits! { pub struct utmpx { pub ut_type: c_short, pub ut_pid: crate::pid_t, @@ -604,24 +531,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_type", &self.ut_type) - .field("ut_pid", &self.ut_pid) - .field("ut_line", &self.ut_line) - .field("ut_id", &self.ut_id) - .field("ut_user", &self.ut_user) - // FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_exit", &self.ut_exit) - .field("ut_session", &self.ut_session) - .field("ut_tv", &self.ut_tv) - .field("ut_addr_v6", &self.ut_addr_v6) - .field("__glibc_reserved", &self.__glibc_reserved) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_type.hash(state); @@ -650,18 +559,6 @@ cfg_if! { impl Eq for __c_anonymous_ptrace_syscall_info_data {} - impl fmt::Debug for __c_anonymous_ptrace_syscall_info_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous_ptrace_syscall_info_data") - .field("entry", &self.entry) - .field("exit", &self.exit) - .field("seccomp", &self.seccomp) - .finish() - } - } - } - impl hash::Hash for __c_anonymous_ptrace_syscall_info_data { fn hash(&self, state: &mut H) { unsafe { @@ -1177,12 +1074,14 @@ extern "C" { compar: Option c_int>, arg: *mut c_void, ); + #[cfg_attr(gnu_time_bits64, link_name = "__sendmmsg64")] pub fn sendmmsg( sockfd: c_int, msgvec: *mut crate::mmsghdr, vlen: c_uint, flags: c_int, ) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__recvmmsg64")] pub fn recvmmsg( sockfd: c_int, msgvec: *mut crate::mmsghdr, @@ -1221,15 +1120,20 @@ extern "C" { pub fn endutxent(); pub fn getpt() -> c_int; pub fn mallopt(param: c_int, value: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__gettimeofday64")] pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; pub fn getauxval(type_: c_ulong) -> c_ulong; + #[cfg_attr(gnu_time_bits64, link_name = "___adjtimex64")] pub fn adjtimex(buf: *mut timex) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "___adjtimex64")] pub fn ntp_adjtime(buf: *mut timex) -> c_int; - #[link_name = "ntp_gettimex"] + #[cfg_attr(not(gnu_time_bits64), link_name = "ntp_gettimex")] + #[cfg_attr(gnu_time_bits64, link_name = "__ntp_gettime64")] pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__clock_adjtime64")] pub fn clock_adjtime(clk_id: crate::clockid_t, buf: *mut crate::timex) -> c_int; pub fn fanotify_mark( @@ -1284,12 +1188,14 @@ extern "C" { pub fn ctermid(s: *mut c_char) -> *mut c_char; pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__glob64_time64")] pub fn glob64( pattern: *const c_char, flags: c_int, errfunc: Option c_int>, pglob: *mut glob64_t, ) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__globfree64_time64")] pub fn globfree64(pglob: *mut glob64_t); pub fn ptrace(request: c_uint, ...) -> c_long; pub fn pthread_attr_getaffinity_np( @@ -1357,6 +1263,7 @@ extern "C" { pub fn eaccess(pathname: *const c_char, mode: c_int) -> c_int; pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char; + #[cfg_attr(gnu_time_bits64, link_name = "__ctime64_r")] pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char; pub fn dirname(path: *mut c_char) -> *mut c_char; @@ -1421,6 +1328,7 @@ extern "C" { pub fn mq_notify(mqdes: crate::mqd_t, sevp: *const crate::sigevent) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__epoll_pwait2_time64")] pub fn epoll_pwait2( epfd: c_int, events: *mut crate::epoll_event, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index bfae5592a431c..9439ce257fffd 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1880,15 +1880,6 @@ cfg_if! { } } impl Eq for sockaddr_nl {} - impl fmt::Debug for sockaddr_nl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_nl") - .field("nl_family", &self.nl_family) - .field("nl_pid", &self.nl_pid) - .field("nl_groups", &self.nl_groups) - .finish() - } - } impl hash::Hash for sockaddr_nl { fn hash(&self, state: &mut H) { self.nl_family.hash(state); @@ -1913,18 +1904,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -1951,18 +1930,6 @@ cfg_if! { impl Eq for dirent64 {} - impl fmt::Debug for dirent64 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent64") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent64 { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -1981,14 +1948,6 @@ cfg_if! { impl Eq for pthread_cond_t {} - impl fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_cond_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } - impl hash::Hash for pthread_cond_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -2003,14 +1962,6 @@ cfg_if! { impl Eq for pthread_mutex_t {} - impl fmt::Debug for pthread_mutex_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_mutex_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } - impl hash::Hash for pthread_mutex_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -2025,14 +1976,6 @@ cfg_if! { impl Eq for pthread_rwlock_t {} - impl fmt::Debug for pthread_rwlock_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_rwlock_t") - // FIXME(debug): .field("size", &self.size) - .finish() - } - } - impl hash::Hash for pthread_rwlock_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -2047,14 +1990,6 @@ cfg_if! { impl Eq for pthread_barrier_t {} - impl fmt::Debug for pthread_barrier_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_barrier_t") - .field("size", &self.size) - .finish() - } - } - impl hash::Hash for pthread_barrier_t { fn hash(&self, state: &mut H) { self.size.hash(state); @@ -2081,18 +2016,6 @@ cfg_if! { impl Eq for sockaddr_alg {} - impl fmt::Debug for sockaddr_alg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_alg") - .field("salg_family", &self.salg_family) - .field("salg_type", &self.salg_type) - .field("salg_feat", &self.salg_feat) - .field("salg_mask", &self.salg_mask) - .field("salg_name", &&self.salg_name[..]) - .finish() - } - } - impl hash::Hash for sockaddr_alg { fn hash(&self, state: &mut H) { self.salg_family.hash(state); @@ -2112,16 +2035,6 @@ cfg_if! { } impl Eq for uinput_setup {} - impl fmt::Debug for uinput_setup { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uinput_setup") - .field("id", &self.id) - .field("name", &&self.name[..]) - .field("ff_effects_max", &self.ff_effects_max) - .finish() - } - } - impl hash::Hash for uinput_setup { fn hash(&self, state: &mut H) { self.id.hash(state); @@ -2143,20 +2056,6 @@ cfg_if! { } impl Eq for uinput_user_dev {} - impl fmt::Debug for uinput_user_dev { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uinput_setup") - .field("name", &&self.name[..]) - .field("id", &self.id) - .field("ff_effects_max", &self.ff_effects_max) - .field("absmax", &&self.absmax[..]) - .field("absmin", &&self.absmin[..]) - .field("absfuzz", &&self.absfuzz[..]) - .field("absflat", &&self.absflat[..]) - .finish() - } - } - impl hash::Hash for uinput_user_dev { fn hash(&self, state: &mut H) { self.name.hash(state); @@ -2186,15 +2085,6 @@ cfg_if! { #[allow(deprecated)] impl Eq for af_alg_iv {} - #[allow(deprecated)] - impl fmt::Debug for af_alg_iv { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("af_alg_iv") - .field("ivlen", &self.ivlen) - .finish() - } - } - #[allow(deprecated)] impl hash::Hash for af_alg_iv { fn hash(&self, state: &mut H) { @@ -2211,16 +2101,6 @@ cfg_if! { } } impl Eq for mq_attr {} - impl fmt::Debug for mq_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mq_attr") - .field("mq_flags", &self.mq_flags) - .field("mq_maxmsg", &self.mq_maxmsg) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_curmsgs", &self.mq_curmsgs) - .finish() - } - } impl hash::Hash for mq_attr { fn hash(&self, state: &mut H) { self.mq_flags.hash(state); @@ -2229,31 +2109,6 @@ cfg_if! { self.mq_curmsgs.hash(state); } } - impl fmt::Debug for ifreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifreq") - .field("ifr_name", &self.ifr_name) - .field("ifr_ifru", &self.ifr_ifru) - .finish() - } - } - impl fmt::Debug for ifconf { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifconf") - .field("ifc_len", &self.ifc_len) - .field("ifc_ifcu", &self.ifc_ifcu) - .finish() - } - } - impl fmt::Debug for hwtstamp_config { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("hwtstamp_config") - .field("flags", &self.flags) - .field("tx_type", &self.tx_type) - .field("rx_filter", &self.rx_filter) - .finish() - } - } impl PartialEq for hwtstamp_config { fn eq(&self, other: &hwtstamp_config) -> bool { self.flags == other.flags @@ -2270,20 +2125,6 @@ cfg_if! { } } - impl fmt::Debug for sched_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sched_attr") - .field("size", &self.size) - .field("sched_policy", &self.sched_policy) - .field("sched_flags", &self.sched_flags) - .field("sched_nice", &self.sched_nice) - .field("sched_priority", &self.sched_priority) - .field("sched_runtime", &self.sched_runtime) - .field("sched_deadline", &self.sched_deadline) - .field("sched_period", &self.sched_period) - .finish() - } - } impl PartialEq for sched_attr { fn eq(&self, other: &sched_attr) -> bool { self.size == other.size @@ -2309,25 +2150,6 @@ cfg_if! { self.sched_period.hash(state); } } - - impl fmt::Debug for iw_event { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("iw_event") - .field("len", &self.len) - .field("cmd", &self.cmd) - .field("u", &self.u) - .finish() - } - } - - impl fmt::Debug for iwreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("iwreq") - .field("ifr_ifrn", &self.ifr_ifrn) - .field("u", &self.u) - .finish() - } - } } } @@ -6316,6 +6138,7 @@ cfg_if! { pub fn aio_error(aiocbp: *const aiocb) -> c_int; #[cfg_attr(gnu_file_offset_bits64, link_name = "aio_return64")] pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; + #[cfg_attr(gnu_time_bits64, link_name = "__aio_suspend_time64")] pub fn aio_suspend( aiocb_list: *const *const aiocb, nitems: c_int, @@ -6377,6 +6200,7 @@ cfg_if! { riovcnt: c_ulong, flags: c_ulong, ) -> isize; + #[cfg_attr(gnu_time_bits64, link_name = "__futimes64")] pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; } } @@ -6406,6 +6230,7 @@ cfg_if! { msg_len: size_t, msg_prio: *mut c_uint, ) -> ssize_t; + #[cfg_attr(gnu_time_bits64, link_name = "__mq_timedreceive_time64")] pub fn mq_timedreceive( mqd: crate::mqd_t, msg_ptr: *mut c_char, @@ -6419,6 +6244,7 @@ cfg_if! { msg_len: size_t, msg_prio: c_uint, ) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__mq_timedsend_time64")] pub fn mq_timedsend( mqd: crate::mqd_t, msg_ptr: *const c_char, @@ -6469,6 +6295,7 @@ extern "C" { pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; pub fn lcong48(p: *mut c_ushort); + #[cfg_attr(gnu_time_bits64, link_name = "__lutimes64")] pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; pub fn setpwent(); @@ -6490,11 +6317,14 @@ extern "C" { pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; pub fn shmdt(shmaddr: *const c_void) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__shmctl64")] pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int; pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__semctl64")] pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__msgctl64")] pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; pub fn msgrcv( @@ -6561,7 +6391,9 @@ extern "C" { pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int; pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int; pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__timerfd_gettime64")] pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__timerfd_settime64")] pub fn timerfd_settime( fd: c_int, flags: c_int, @@ -6577,6 +6409,7 @@ extern "C" { sigmask: *const crate::sigset_t, ) -> c_int; pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__sigtimedwait64")] pub fn sigtimedwait( set: *const sigset_t, info: *mut siginfo_t, @@ -6618,14 +6451,22 @@ extern "C" { ... ) -> *mut c_void; - #[cfg_attr(gnu_file_offset_bits64, link_name = "glob64")] + #[cfg_attr(gnu_time_bits64, link_name = "__glob64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "glob64" + )] pub fn glob( pattern: *const c_char, flags: c_int, errfunc: Option c_int>, pglob: *mut crate::glob_t, ) -> c_int; - #[cfg_attr(gnu_file_offset_bits64, link_name = "globfree64")] + #[cfg_attr(gnu_time_bits64, link_name = "__globfree64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "globfree64" + )] pub fn globfree(pglob: *mut crate::glob_t); pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; @@ -6688,6 +6529,7 @@ extern "C" { pub fn umount(target: *const c_char) -> c_int; pub fn sched_get_priority_max(policy: c_int) -> c_int; pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t; + #[cfg_attr(gnu_time_bits64, link_name = "__settimeofday64")] pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; pub fn splice( fd_in: c_int, @@ -6701,7 +6543,9 @@ extern "C" { pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int; pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__sched_rr_get_interval64")] pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__sem_timedwait64")] pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; @@ -6717,8 +6561,10 @@ extern "C" { data: *const c_void, ) -> c_int; pub fn personality(persona: c_ulong) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__prctl_time64")] pub fn prctl(option: c_int, ...) -> c_int; pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__ppoll64")] pub fn ppoll( fds: *mut crate::pollfd, nfds: nfds_t, @@ -6731,6 +6577,7 @@ extern "C" { ) -> c_int; pub fn pthread_mutexattr_setprotocol(attr: *mut pthread_mutexattr_t, protocol: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__pthread_mutex_timedlock64")] pub fn pthread_mutex_timedlock( lock: *mut pthread_mutex_t, abstime: *const crate::timespec, @@ -6765,6 +6612,7 @@ extern "C" { ... ) -> c_int; pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__clock_nanosleep_time64")] pub fn clock_nanosleep( clk_id: crate::clockid_t, flags: c_int, @@ -7022,7 +6870,9 @@ extern "C" { ) -> c_int; pub fn timer_delete(timerid: crate::timer_t) -> c_int; pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__timer_gettime64")] pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__timer_settime64")] pub fn timer_settime( timerid: crate::timer_t, flags: c_int, diff --git a/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/src/unix/linux_like/linux/musl/b32/arm/mod.rs index a79b3fa3729ed..b9be033a2c2c4 100644 --- a/src/unix/linux_like/linux/musl/b32/arm/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/arm/mod.rs @@ -162,17 +162,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_link) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - .finish() - } - } impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/src/unix/linux_like/linux/musl/b32/x86/mod.rs index c42bed66900e4..583e0a51eacb0 100644 --- a/src/unix/linux_like/linux/musl/b32/x86/mod.rs +++ b/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -167,26 +167,6 @@ cfg_if! { impl Eq for user_fpxregs_struct {} - impl fmt::Debug for user_fpxregs_struct { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("user_fpxregs_struct") - .field("cwd", &self.cwd) - .field("swd", &self.swd) - .field("twd", &self.twd) - .field("fop", &self.fop) - .field("fip", &self.fip) - .field("fcs", &self.fcs) - .field("foo", &self.foo) - .field("fos", &self.fos) - .field("mxcsr", &self.mxcsr) - // Ignore __reserved field - .field("st_space", &self.st_space) - .field("xmm_space", &self.xmm_space) - // Ignore padding field - .finish() - } - } - impl hash::Hash for user_fpxregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); @@ -222,19 +202,6 @@ cfg_if! { impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - // Ignore __private field - .finish() - } - } - impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs index 55ffc20c31dbd..17724b528415e 100644 --- a/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs @@ -7,8 +7,6 @@ pub type wchar_t = c_int; pub type nlink_t = c_uint; pub type blksize_t = c_int; -pub type fsblkcnt64_t = c_ulong; -pub type fsfilcnt64_t = c_ulong; pub type __u64 = c_ulonglong; pub type __s64 = c_longlong; diff --git a/src/unix/linux_like/linux/musl/b64/s390x.rs b/src/unix/linux_like/linux/musl/b64/s390x.rs index fe9f798d00863..0f1062860d1ca 100644 --- a/src/unix/linux_like/linux/musl/b64/s390x.rs +++ b/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -88,12 +88,6 @@ cfg_if! { impl Eq for fpreg_t {} - impl fmt::Debug for fpreg_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpreg_t").field("d", &self.d).finish() - } - } - impl hash::Hash for fpreg_t { fn hash(&self, state: &mut H) { let d: u64 = self.d.to_bits(); diff --git a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs index c02744c5183dd..17a9f6ce47475 100644 --- a/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -202,23 +202,6 @@ cfg_if! { impl Eq for user_fpregs_struct {} - impl fmt::Debug for user_fpregs_struct { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("user_fpregs_struct") - .field("cwd", &self.cwd) - .field("ftw", &self.ftw) - .field("fop", &self.fop) - .field("rip", &self.rip) - .field("rdp", &self.rdp) - .field("mxcsr", &self.mxcsr) - .field("mxcr_mask", &self.mxcr_mask) - .field("st_space", &self.st_space) - // FIXME(debug): .field("xmm_space", &self.xmm_space) - // Ignore padding field - .finish() - } - } - impl hash::Hash for user_fpregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); @@ -251,19 +234,6 @@ cfg_if! { impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_sigmask", &self.uc_sigmask) - // Ignore __private field - .finish() - } - } - impl hash::Hash for ucontext_t { fn hash(&self, state: &mut H) { self.uc_flags.hash(state); diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 9931847672ad4..fb083fd54eea0 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -492,27 +492,6 @@ cfg_if! { impl Eq for sysinfo {} - impl fmt::Debug for sysinfo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sysinfo") - .field("uptime", &self.uptime) - .field("loads", &self.loads) - .field("totalram", &self.totalram) - .field("freeram", &self.freeram) - .field("sharedram", &self.sharedram) - .field("bufferram", &self.bufferram) - .field("totalswap", &self.totalswap) - .field("freeswap", &self.freeswap) - .field("procs", &self.procs) - .field("pad", &self.pad) - .field("totalhigh", &self.totalhigh) - .field("freehigh", &self.freehigh) - .field("mem_unit", &self.mem_unit) - // FIXME(debug): .field("__reserved", &self.__reserved) - .finish() - } - } - impl hash::Hash for sysinfo { fn hash(&self, state: &mut H) { self.uptime.hash(state); @@ -557,27 +536,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - #[allow(deprecated)] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_type", &self.ut_type) - //.field("__ut_pad1", &self.__ut_pad1) - .field("ut_pid", &self.ut_pid) - .field("ut_line", &self.ut_line) - .field("ut_id", &self.ut_id) - .field("ut_user", &self.ut_user) - //FIXME(debug): .field("ut_host", &self.ut_host) - .field("ut_exit", &self.ut_exit) - .field("ut_session", &self.ut_session) - //.field("__ut_pad2", &self.__ut_pad2) - .field("ut_tv", &self.ut_tv) - .field("ut_addr_v6", &self.ut_addr_v6) - .field("__unused", &self.__unused) - .finish() - } - } - impl hash::Hash for utmpx { #[allow(deprecated)] fn hash(&self, state: &mut H) { diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index b7a34dd3b6716..4fef82ed8e167 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -1,3 +1,6 @@ +// FIXME(ulibc): this module has definitions that are redundant with the parent +#![allow(dead_code)] + use crate::off64_t; use crate::prelude::*; diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index aab4cb385e000..a2969e854fdc9 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -334,16 +334,6 @@ cfg_if! { } } impl Eq for epoll_event {} - impl fmt::Debug for epoll_event { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let events = self.events; - let u64 = self.u64; - f.debug_struct("epoll_event") - .field("events", &events) - .field("u64", &u64) - .finish() - } - } impl hash::Hash for epoll_event { fn hash(&self, state: &mut H) { let events = self.events; @@ -364,14 +354,6 @@ cfg_if! { } } impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_family.hash(state); @@ -392,16 +374,6 @@ cfg_if! { impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_family", &self.ss_family) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } - impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_family.hash(state); @@ -445,19 +417,6 @@ cfg_if! { impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - // FIXME(debug): .field("domainname", &self.domainname) - .finish() - } - } - impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); @@ -478,16 +437,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_value", &self.sigev_value) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_notify", &self.sigev_notify) - .field("sigev_notify_thread_id", &self.sigev_notify_thread_id) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_value.hash(state); @@ -1826,6 +1775,7 @@ cfg_if! { } extern "C" { + #[cfg_attr(gnu_time_bits64, link_name = "__ioctl_time64")] pub fn ioctl(fd: c_int, request: Ioctl, ...) -> c_int; } } @@ -1971,8 +1921,11 @@ extern "C" { pub fn fdatasync(fd: c_int) -> c_int; pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__clock_getres64")] pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__clock_gettime64")] pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__clock_settime64")] pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; @@ -1999,7 +1952,9 @@ extern "C" { pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; #[cfg_attr(gnu_file_offset_bits64, link_name = "posix_fadvise64")] pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__futimens64")] pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__utimensat64")] pub fn utimensat( dirfd: c_int, path: *const c_char, @@ -2054,6 +2009,7 @@ extern "C" { pub fn vfork() -> crate::pid_t; pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__wait4_time64")] pub fn wait4( pid: crate::pid_t, status: *mut c_int, @@ -2081,7 +2037,9 @@ extern "C" { pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; + #[cfg_attr(gnu_time_bits64, link_name = "__sendmsg64")] pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; + #[cfg_attr(gnu_time_bits64, link_name = "__recvmsg64")] pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; pub fn uname(buf: *mut crate::utsname) -> c_int; @@ -2123,7 +2081,9 @@ cfg_if! { pub fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int; pub fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int; pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__fstat64_time64")] pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__fstatat64_time64")] pub fn fstatat64( dirfd: c_int, pathname: *const c_char, @@ -2132,6 +2092,7 @@ cfg_if! { ) -> c_int; pub fn ftruncate64(fd: c_int, length: off64_t) -> c_int; pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t; + #[cfg_attr(gnu_time_bits64, link_name = "__lstat64_time64")] pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int; pub fn mmap64( addr: *mut c_void, @@ -2162,6 +2123,7 @@ cfg_if! { entry: *mut crate::dirent64, result: *mut *mut crate::dirent64, ) -> c_int; + #[cfg_attr(gnu_time_bits64, link_name = "__stat64_time64")] pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; pub fn truncate64(path: *const c_char, length: off64_t) -> c_int; } diff --git a/src/unix/mod.rs b/src/unix/mod.rs index d6259ea0f35dd..96209e7e72cd7 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -56,14 +56,19 @@ s! { pub modtime: time_t, } - // FIXME(time): Needs updates at least for glibc _TIME_BITS=64 pub struct timeval { pub tv_sec: time_t, + #[cfg(not(gnu_time_bits64))] pub tv_usec: suseconds_t, + // For 64 bit time on 32 bit linux glibc, suseconds_t is still + // a 32 bit type. Use __suseconds64_t instead + #[cfg(gnu_time_bits64)] + pub tv_usec: __suseconds64_t, } // linux x32 compatibility // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 + #[cfg(not(target_env = "gnu"))] pub struct timespec { pub tv_sec: time_t, #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] @@ -562,7 +567,7 @@ cfg_if! { } cfg_if! { - if #[cfg(not(target_env = "gnu"))] { + if #[cfg(not(all(target_os = "linux", target_env = "gnu")))] { missing! { #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum fpos_t {} // FIXME(unix): fill this out with a struct @@ -804,6 +809,7 @@ extern "C" { pub fn getsockname(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int; #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")] + #[cfg_attr(gnu_time_bits64, link_name = "__setsockopt64")] pub fn setsockopt( socket: c_int, level: c_int, @@ -866,7 +872,11 @@ extern "C" { all(target_os = "freebsd", any(freebsd11, freebsd10)), link_name = "fstat@FBSD_1.0" )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "fstat64")] + #[cfg_attr(gnu_time_bits64, link_name = "__fstat64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "fstat64" + )] pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; @@ -880,7 +890,11 @@ extern "C" { all(target_os = "freebsd", any(freebsd11, freebsd10)), link_name = "stat@FBSD_1.0" )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "stat64")] + #[cfg_attr(gnu_time_bits64, link_name = "__stat64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "stat64" + )] pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; pub fn pclose(stream: *mut crate::FILE) -> c_int; @@ -907,7 +921,11 @@ extern "C" { all(target_os = "macos", target_arch = "x86"), link_name = "fcntl$UNIX2003" )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "__fcntl_time64")] + #[cfg_attr(gnu_time_bits64, link_name = "__fcntl_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "__fcntl_time64" + )] pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; #[cfg_attr( @@ -964,7 +982,11 @@ extern "C" { all(target_os = "freebsd", any(freebsd11, freebsd10)), link_name = "fstatat@FBSD_1.1" )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "fstatat64")] + #[cfg_attr(gnu_time_bits64, link_name = "__fstatat64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "fstatat64" + )] pub fn fstatat(dirfd: c_int, pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; pub fn linkat( olddirfd: c_int, @@ -1069,6 +1091,7 @@ extern "C" { link_name = "nanosleep$UNIX2003" )] #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")] + #[cfg_attr(gnu_time_bits64, link_name = "__nanosleep64")] pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; pub fn tcgetpgrp(fd: c_int) -> pid_t; pub fn tcsetpgrp(fd: c_int, pgrp: crate::pid_t) -> c_int; @@ -1113,6 +1136,7 @@ extern "C" { pub fn umask(mask: mode_t) -> mode_t; #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] + #[cfg_attr(gnu_time_bits64, link_name = "__utime64")] pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int; #[cfg_attr( @@ -1162,7 +1186,11 @@ extern "C" { all(target_os = "freebsd", any(freebsd11, freebsd10)), link_name = "lstat@FBSD_1.0" )] - #[cfg_attr(gnu_file_offset_bits64, link_name = "lstat64")] + #[cfg_attr(gnu_time_bits64, link_name = "__lstat64_time64")] + #[cfg_attr( + all(not(gnu_time_bits64), gnu_file_offset_bits64), + link_name = "lstat64" + )] pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; #[cfg_attr( @@ -1193,6 +1221,7 @@ extern "C" { pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] + #[cfg_attr(gnu_time_bits64, link_name = "__getrusage64")] pub fn getrusage(resource: c_int, usage: *mut rusage) -> c_int; #[cfg_attr( @@ -1268,6 +1297,7 @@ extern "C" { all(target_os = "macos", target_arch = "x86"), link_name = "pthread_cond_timedwait$UNIX2003" )] + #[cfg_attr(gnu_time_bits64, link_name = "__pthread_cond_timedwait64")] pub fn pthread_cond_timedwait( cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t, @@ -1324,6 +1354,7 @@ extern "C" { link_name = "__xnet_getsockopt" )] #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")] + #[cfg_attr(gnu_time_bits64, link_name = "__getsockopt64")] pub fn getsockopt( sockfd: c_int, level: c_int, @@ -1334,6 +1365,7 @@ extern "C" { pub fn raise(signum: c_int) -> c_int; #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")] + #[cfg_attr(gnu_time_bits64, link_name = "__utimes64")] pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int; pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; pub fn dlerror() -> *mut c_char; @@ -1386,10 +1418,12 @@ extern "C" { #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__gmtime64_r")] pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__localtime64_r")] pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), @@ -1398,27 +1432,33 @@ extern "C" { #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__mktime64")] pub fn mktime(tm: *mut tm) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__time50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__time64")] pub fn time(time: *mut time_t) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__gmtime64")] pub fn gmtime(time_p: *const time_t) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__localtime64")] pub fn localtime(time_p: *const time_t) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__difftime64")] pub fn difftime(time1: time_t, time0: time_t) -> c_double; #[cfg(not(target_os = "aix"))] #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")] #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME(time): for `time_t` + #[cfg_attr(gnu_time_bits64, link_name = "__timegm64")] pub fn timegm(tm: *mut crate::tm) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")] @@ -1477,6 +1517,7 @@ extern "C" { )] #[cfg_attr(target_os = "netbsd", link_name = "__select50")] #[cfg_attr(target_os = "aix", link_name = "__fd_select")] + #[cfg_attr(gnu_time_bits64, link_name = "__select64")] pub fn select( nfds: c_int, readfds: *mut fd_set, @@ -1599,6 +1640,7 @@ cfg_if! { target_os = "aix", )))] { extern "C" { + #[cfg_attr(gnu_time_bits64, link_name = "__adjtime64")] pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> c_int; } } else if #[cfg(target_os = "solaris")] { @@ -1752,6 +1794,7 @@ cfg_if! { link_name = "pselect$UNIX2003" )] #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")] + #[cfg_attr(gnu_time_bits64, link_name = "__pselect64")] pub fn pselect( nfds: c_int, readfds: *mut fd_set, diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 209fd3b695e99..581b99e6728f0 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -811,16 +811,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("__sigev_un2", &self.__sigev_un2) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); @@ -842,15 +832,6 @@ cfg_if! { } } impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_len", &self.sun_len) - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { @@ -867,13 +848,6 @@ cfg_if! { } } impl Eq for sigset_t {} - impl fmt::Debug for sigset_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigset_t") - .field("__val", &self.__val) - .finish() - } - } impl hash::Hash for sigset_t { fn hash(&self, state: &mut H) { self.__val.hash(state); @@ -881,50 +855,10 @@ cfg_if! { } // msg - impl fmt::Debug for msg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("msg") - .field("msg_next", &self.msg_next) - .field("msg_type", &self.msg_type) - .field("msg_ts", &self.msg_ts) - .field("msg_spot", &self.msg_spot) - .finish() - } - } // msqid_ds - impl fmt::Debug for msqid_ds { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("msqid_ds") - .field("msg_perm", &self.msg_perm) - .field("msg_first", &self.msg_first) - .field("msg_cbytes", &self.msg_cbytes) - .field("msg_qnum", &self.msg_qnum) - .field("msg_qbytes", &self.msg_qbytes) - .field("msg_lspid", &self.msg_lspid) - .field("msg_lrpid", &self.msg_lrpid) - .field("msg_stime", &self.msg_stime) - .field("msg_rtime", &self.msg_rtime) - .field("msg_ctime", &self.msg_ctime) - .finish() - } - } // sockaddr_dl - impl fmt::Debug for sockaddr_dl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_dl") - .field("sdl_len", &self.sdl_len) - .field("sdl_family", &self.sdl_family) - .field("sdl_index", &self.sdl_index) - .field("sdl_type", &self.sdl_type) - .field("sdl_nlen", &self.sdl_nlen) - .field("sdl_alen", &self.sdl_alen) - .field("sdl_slen", &self.sdl_slen) - .field("sdl_data", &self.sdl_data) - .finish() - } - } impl PartialEq for sockaddr_dl { fn eq(&self, other: &sockaddr_dl) -> bool { self.sdl_len == other.sdl_len @@ -955,73 +889,6 @@ cfg_if! { } } - // sync_t - impl fmt::Debug for sync_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sync_t") - .field("__owner", &self.__owner) - .field("__u", &self.__u) - .finish() - } - } - - // pthread_barrier_t - impl fmt::Debug for pthread_barrier_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_barrier_t") - .field("__pad", &self.__pad) - .finish() - } - } - - // pthread_rwlock_t - impl fmt::Debug for pthread_rwlock_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("pthread_rwlock_t") - .field("__active", &self.__active) - .field("__blockedwriters", &self.__blockedwriters) - .field("__blockedreaders", &self.__blockedreaders) - .field("__heavy", &self.__heavy) - .field("__lock", &self.__lock) - .field("__rcond", &self.__rcond) - .field("__wcond", &self.__wcond) - .field("__owner", &self.__owner) - .field("__spare", &self.__spare) - .finish() - } - } - - // syspage_entry - impl fmt::Debug for syspage_entry { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("syspage_entry") - .field("size", &self.size) - .field("total_size", &self.total_size) - .field("type_", &self.type_) - .field("num_cpu", &self.num_cpu) - .field("system_private", &self.system_private) - .field("old_asinfo", &self.old_asinfo) - .field("hwinfo", &self.hwinfo) - .field("old_cpuinfo", &self.old_cpuinfo) - .field("old_cacheattr", &self.old_cacheattr) - .field("qtime", &self.qtime) - .field("callout", &self.callout) - .field("callin", &self.callin) - .field("typed_strings", &self.typed_strings) - .field("strings", &self.strings) - .field("old_intrinfo", &self.old_intrinfo) - .field("smp", &self.smp) - .field("pminfo", &self.pminfo) - .field("old_mdriver", &self.old_mdriver) - .field("new_asinfo", &self.new_asinfo) - .field("new_cpuinfo", &self.new_cpuinfo) - .field("new_cacheattr", &self.new_cacheattr) - .field("new_intrinfo", &self.new_intrinfo) - .field("new_mdriver", &self.new_mdriver) - .finish() - } - } - impl PartialEq for utsname { fn eq(&self, other: &utsname) -> bool { self.sysname @@ -1053,18 +920,6 @@ cfg_if! { impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - .finish() - } - } - impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); @@ -1089,19 +944,6 @@ cfg_if! { impl Eq for mq_attr {} - impl fmt::Debug for mq_attr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mq_attr") - .field("mq_maxmsg", &self.mq_maxmsg) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_flags", &self.mq_flags) - .field("mq_curmsgs", &self.mq_curmsgs) - .field("mq_msgsize", &self.mq_msgsize) - .field("mq_sendwait", &self.mq_sendwait) - .field("mq_recvwait", &self.mq_recvwait) - .finish() - } - } impl hash::Hash for mq_attr { fn hash(&self, state: &mut H) { self.mq_maxmsg.hash(state); @@ -1129,18 +971,6 @@ cfg_if! { impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } - impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_len.hash(state); @@ -1166,18 +996,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_offset", &self.d_offset) - .field("d_reclen", &self.d_reclen) - .field("d_namelen", &self.d_namelen) - .field("d_name", &&self.d_name[..self.d_namelen as _]) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index d9900d1cb4fe7..859cdccde05cd 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1258,14 +1258,6 @@ extern "C" { ) -> ssize_t; pub fn recvmsg(socket: c_int, msg: *mut msghdr, flags: c_int) -> ssize_t; pub fn sendmsg(socket: c_int, msg: *const msghdr, flags: c_int) -> ssize_t; - pub fn sendto( - socket: c_int, - buf: *const c_void, - len: size_t, - flags: c_int, - addr: *const crate::sockaddr, - addrlen: crate::socklen_t, - ) -> ssize_t; // sys/stat.h pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; @@ -1305,18 +1297,6 @@ cfg_if! { impl Eq for dirent {} - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_off", &self.d_off) - .field("d_reclen", &self.d_reclen) - .field("d_type", &self.d_type) - // FIXME(debug): .field("d_name", &self.d_name) - .finish() - } - } - impl hash::Hash for dirent { fn hash(&self, state: &mut H) { self.d_ino.hash(state); @@ -1340,15 +1320,6 @@ cfg_if! { impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } - impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_family.hash(state); @@ -1370,16 +1341,6 @@ cfg_if! { impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_family", &self.ss_family) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_padding", &self.__ss_padding) - .finish() - } - } - impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_family.hash(state); @@ -1424,19 +1385,6 @@ cfg_if! { impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - // FIXME(debug): .field("domainname", &self.domainname) - .finish() - } - } - impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); diff --git a/src/unix/solarish/compat.rs b/src/unix/solarish/compat.rs index 80d2835977f59..22bcf12edcc82 100644 --- a/src/unix/solarish/compat.rs +++ b/src/unix/solarish/compat.rs @@ -5,9 +5,6 @@ use core::cmp::min; use crate::unix::solarish::*; use crate::{c_char, c_int, size_t}; -const PTEM: &[u8] = b"ptem\0"; -const LDTERM: &[u8] = b"ldterm\0"; - pub unsafe fn cfmakeraw(termios: *mut crate::termios) { (*termios).c_iflag &= !(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); @@ -41,6 +38,7 @@ pub unsafe fn cfsetspeed(termios: *mut crate::termios, speed: crate::speed_t) -> 0 } +#[cfg(target_os = "illumos")] unsafe fn bail(fdm: c_int, fds: c_int) -> c_int { let e = *___errno(); if fds >= 0 { @@ -61,6 +59,9 @@ pub unsafe fn openpty( termp: *const termios, winp: *const crate::winsize, ) -> c_int { + const PTEM: &[u8] = b"ptem\0"; + const LDTERM: &[u8] = b"ldterm\0"; + // Open the main pseudo-terminal device, making sure not to set it as the // controlling terminal for this process: let fdm = crate::posix_openpt(O_RDWR | O_NOCTTY); diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs index 3cb68e4d6fca4..fbeadaf344fa0 100644 --- a/src/unix/solarish/illumos.rs +++ b/src/unix/solarish/illumos.rs @@ -89,24 +89,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_user", &self.ut_user) - .field("ut_id", &self.ut_id) - .field("ut_line", &self.ut_line) - .field("ut_pid", &self.ut_pid) - .field("ut_type", &self.ut_type) - .field("ut_exit", &self.ut_exit) - .field("ut_tv", &self.ut_tv) - .field("ut_session", &self.ut_session) - .field("ut_pad", &self.ut_pad) - .field("ut_syslen", &self.ut_syslen) - .field("ut_host", &&self.ut_host[..]) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_user.hash(state); @@ -129,16 +111,6 @@ cfg_if! { } } impl Eq for epoll_event {} - impl fmt::Debug for epoll_event { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let events = self.events; - let u64 = self.u64; - f.debug_struct("epoll_event") - .field("events", &events) - .field("u64", &u64) - .finish() - } - } impl hash::Hash for epoll_event { fn hash(&self, state: &mut H) { let events = self.events; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 605e35ca53bf9..9f90c4cbaaedc 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -585,14 +585,6 @@ cfg_if! { } } impl Eq for sockaddr_un {} - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_family", &self.sun_family) - // FIXME(debug): .field("sun_path", &self.sun_path) - .finish() - } - } impl hash::Hash for sockaddr_un { fn hash(&self, state: &mut H) { self.sun_family.hash(state); @@ -629,17 +621,6 @@ cfg_if! { } } impl Eq for utsname {} - impl fmt::Debug for utsname { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utsname") - // FIXME(debug): .field("sysname", &self.sysname) - // FIXME(debug): .field("nodename", &self.nodename) - // FIXME(debug): .field("release", &self.release) - // FIXME(debug): .field("version", &self.version) - // FIXME(debug): .field("machine", &self.machine) - .finish() - } - } impl hash::Hash for utsname { fn hash(&self, state: &mut H) { self.sysname.hash(state); @@ -659,13 +640,6 @@ cfg_if! { } } impl Eq for fd_set {} - impl fmt::Debug for fd_set { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fd_set") - // FIXME(debug): .field("fds_bits", &self.fds_bits) - .finish() - } - } impl hash::Hash for fd_set { fn hash(&self, state: &mut H) { self.fds_bits.hash(state); @@ -685,16 +659,6 @@ cfg_if! { } } impl Eq for sockaddr_storage {} - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &self.__ss_pad1) - .field("__ss_align", &self.__ss_align) - // FIXME(debug): .field("__ss_pad2", &self.__ss_pad2) - .finish() - } - } impl hash::Hash for sockaddr_storage { fn hash(&self, state: &mut H) { self.ss_family.hash(state); @@ -754,16 +718,6 @@ cfg_if! { } } impl Eq for siginfo_t {} - impl fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("siginfo_t") - .field("si_signo", &self.si_signo) - .field("si_code", &self.si_code) - .field("si_errno", &self.si_errno) - // FIXME(debug): .field("__pad", &self.__pad) - .finish() - } - } impl hash::Hash for siginfo_t { fn hash(&self, state: &mut H) { self.si_signo.hash(state); @@ -794,19 +748,6 @@ cfg_if! { } } impl Eq for sockaddr_dl {} - impl fmt::Debug for sockaddr_dl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_dl") - .field("sdl_family", &self.sdl_family) - .field("sdl_index", &self.sdl_index) - .field("sdl_type", &self.sdl_type) - .field("sdl_nlen", &self.sdl_nlen) - .field("sdl_alen", &self.sdl_alen) - .field("sdl_slen", &self.sdl_slen) - // FIXME(debug): .field("sdl_data", &self.sdl_data) - .finish() - } - } impl hash::Hash for sockaddr_dl { fn hash(&self, state: &mut H) { self.sdl_family.hash(state); @@ -829,17 +770,6 @@ cfg_if! { } } impl Eq for sigevent {} - impl fmt::Debug for sigevent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigevent") - .field("sigev_notify", &self.sigev_notify) - .field("sigev_signo", &self.sigev_signo) - .field("sigev_value", &self.sigev_value) - .field("ss_sp", &self.ss_sp) - .field("sigev_notify_attributes", &self.sigev_notify_attributes) - .finish() - } - } impl hash::Hash for sigevent { fn hash(&self, state: &mut H) { self.sigev_notify.hash(state); diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs index 7baa8a1a2b675..097ff1c9cd6bd 100644 --- a/src/unix/solarish/solaris.rs +++ b/src/unix/solarish/solaris.rs @@ -125,24 +125,6 @@ cfg_if! { impl Eq for utmpx {} - impl fmt::Debug for utmpx { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("utmpx") - .field("ut_user", &self.ut_user) - .field("ut_id", &self.ut_id) - .field("ut_line", &self.ut_line) - .field("ut_pid", &self.ut_pid) - .field("ut_type", &self.ut_type) - .field("ut_exit", &self.ut_exit) - .field("ut_tv", &self.ut_tv) - .field("ut_session", &self.ut_session) - .field("pad", &self.pad) - .field("ut_syslen", &self.ut_syslen) - .field("ut_host", &&self.ut_host[..]) - .finish() - } - } - impl hash::Hash for utmpx { fn hash(&self, state: &mut H) { self.ut_user.hash(state); diff --git a/src/unix/solarish/x86_64.rs b/src/unix/solarish/x86_64.rs index 2f82d244863aa..a45ca4b7d0976 100644 --- a/src/unix/solarish/x86_64.rs +++ b/src/unix/solarish/x86_64.rs @@ -118,27 +118,12 @@ cfg_if! { } } impl Eq for fpregset_t {} - impl fmt::Debug for fpregset_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("fpregset_t") - .field("fp_reg_set", &self.fp_reg_set) - .finish() - } - } impl PartialEq for mcontext_t { fn eq(&self, other: &mcontext_t) -> bool { self.gregs == other.gregs && self.fpregs == other.fpregs } } impl Eq for mcontext_t {} - impl fmt::Debug for mcontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mcontext_t") - .field("gregs", &self.gregs) - .field("fpregs", &self.fpregs) - .finish() - } - } impl PartialEq for ucontext_t { fn eq(&self, other: &ucontext_t) -> bool { self.uc_flags == other.uc_flags @@ -150,18 +135,6 @@ cfg_if! { } } impl Eq for ucontext_t {} - impl fmt::Debug for ucontext_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ucontext_t") - .field("uc_flags", &self.uc_flags) - .field("uc_link", &self.uc_link) - .field("uc_sigmask", &self.uc_sigmask) - .field("uc_stack", &self.uc_stack) - .field("uc_mcontext", &self.uc_mcontext) - .field("uc_filler", &self.uc_filler) - .finish() - } - } } } diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 793379dcdd792..deef310db8e0f 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -454,53 +454,6 @@ s_no_extra_traits! { cfg_if! { if #[cfg(feature = "extra_traits")] { - impl fmt::Debug for dirent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("dirent") - .field("d_ino", &self.d_ino) - .field("d_name", &&self.d_name[..]) - .field("d_type", &self.d_type) - .finish() - } - } - - impl fmt::Debug for sockaddr_un { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_un") - .field("sun_len", &self.sun_len) - .field("sun_family", &self.sun_family) - .field("sun_path", &&self.sun_path[..]) - .finish() - } - } - - impl fmt::Debug for RTP_DESC { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("RTP_DESC") - .field("status", &self.status) - .field("options", &self.options) - .field("entrAddr", &self.entrAddr) - .field("initTaskId", &self.initTaskId) - .field("parentId", &self.parentId) - .field("pathName", &&self.pathName[..]) - .field("taskCnt", &self.taskCnt) - .field("textStart", &self.textStart) - .field("textEnd", &self.textEnd) - .finish() - } - } - impl fmt::Debug for sockaddr_storage { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sockaddr_storage") - .field("ss_len", &self.ss_len) - .field("ss_family", &self.ss_family) - .field("__ss_pad1", &&self.__ss_pad1[..]) - .field("__ss_align", &self.__ss_align) - .field("__ss_pad2", &&self.__ss_pad2[..]) - .finish() - } - } - impl PartialEq for sa_u_t { fn eq(&self, other: &sa_u_t) -> bool { unsafe {