diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index a983d62341dcf..05edfe7d3ac2a 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3945,6 +3945,7 @@ pthread_spin_lock pthread_spin_trylock pthread_spin_unlock pthread_spinlock_t +ptp_clock_caps ptp_clock_time ptp_extts_event ptp_extts_request diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 2bfd2fc145a97..08eeadb900850 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1195,6 +1195,71 @@ s! { pub rsv: [::c_uint; 5], } + cfg_if! { + if #[cfg(all(target_arch = "loongarch64", target_env = "musl"))] { + pub struct ptp_clock_caps { + pub max_adj: ::c_int, + pub n_alarm: ::c_int, + pub n_ext_ts: ::c_int, + pub n_per_out: ::c_int, + pub pps: ::c_int, + pub n_pins: ::c_int, + pub cross_timestamping: ::c_int, + pub adjust_phase: ::c_int, + pub rsv: [::c_int; 12], + } + } else if #[cfg(all(target_arch = "loongarch64", target_env = "gnu"))] { + pub struct ptp_clock_caps { + pub max_adj: ::c_int, + pub n_alarm: ::c_int, + pub n_ext_ts: ::c_int, + pub n_per_out: ::c_int, + pub pps: ::c_int, + pub n_pins: ::c_int, + pub cross_timestamping: ::c_int, + pub adjust_phase: ::c_int, + pub max_phase_adj: ::c_int, + pub rsv: [::c_int; 11], + } + } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { + pub struct ptp_clock_caps { + pub max_adj: ::c_int, + pub n_alarm: ::c_int, + pub n_ext_ts: ::c_int, + pub n_per_out: ::c_int, + pub pps: ::c_int, + pub n_pins: ::c_int, + pub cross_timestamping: ::c_int, + pub adjust_phase: ::c_int, + pub rsv: [::c_int; 12], + } + } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { + pub struct ptp_clock_caps { + pub max_adj: ::c_int, + pub n_alarm: ::c_int, + pub n_ext_ts: ::c_int, + pub n_per_out: ::c_int, + pub pps: ::c_int, + pub n_pins: ::c_int, + pub cross_timestamping: ::c_int, + pub rsv: [::c_int; 13], + } + } else { + pub struct ptp_clock_caps { + pub max_adj: ::c_int, + pub n_alarm: ::c_int, + pub n_ext_ts: ::c_int, + pub n_per_out: ::c_int, + pub pps: ::c_int, + pub n_pins: ::c_int, + pub cross_timestamping: ::c_int, + pub adjust_phase: ::c_int, + pub max_phase_adj: ::c_int, + pub rsv: [::c_int; 11], + } + } + } + // linux/if_xdp.h pub struct xsk_tx_metadata_completion { pub tx_timestamp: ::__u64,