Skip to content

Commit 6d7e27d

Browse files
committed
use PTP_MAX_SAMPLES in struct definitions
1 parent f920867 commit 6d7e27d

File tree

1 file changed

+3
-3
lines changed
  • src/unix/linux_like/linux

1 file changed

+3
-3
lines changed

src/unix/linux_like/linux/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ s! {
838838
pub struct ptp_sys_offset_extended {
839839
pub n_samples: ::c_uint,
840840
pub rsv: [::c_uint; 3],
841-
pub ts: [[ptp_clock_time; 3]; 25],
841+
pub ts: [[ptp_clock_time; 3]; PTP_MAX_SAMPLES as usize],
842842
}
843843

844844
pub struct ptp_sys_offset_precise {
@@ -1256,7 +1256,7 @@ s_no_extra_traits! {
12561256
pub struct ptp_sys_offset {
12571257
pub n_samples: ::c_uint,
12581258
pub rsv: [::c_uint; 3],
1259-
pub ts: [ptp_clock_time; 51],
1259+
pub ts: [ptp_clock_time; 2 * PTP_MAX_SAMPLES as usize + 1],
12601260
}
12611261

12621262
pub struct ptp_pin_desc {
@@ -4243,7 +4243,7 @@ pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14;
42434243
pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15;
42444244

42454245
// linux/ptp_clock.h
4246-
pub const PTP_MAX_SAMPLES: ::c_uint = 25;
4246+
pub const PTP_MAX_SAMPLES: ::c_uint = 25; // Maximum allowed offset measurement samples.
42474247

42484248
cfg_if! {
42494249
if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64", target_arch = "sparc64"))] {

0 commit comments

Comments
 (0)