Skip to content

Commit 032d105

Browse files
committed
Auto merge of #2415 - ghedo:sock_txtime, r=JohnTitor
Add struct sock_txtime and related flags These are needed to use the SO_TXTIME socket option on Linux, which is already exposed.
2 parents ee0c4f5 + 07e5721 commit 032d105

File tree

1 file changed

+19
-0
lines changed
  • src/unix/linux_like/linux

1 file changed

+19
-0
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,19 @@ s_no_extra_traits! {
670670
}
671671
}
672672

673+
cfg_if! {
674+
if #[cfg(not(all(target_env = "musl", target_arch = "mips")))] {
675+
s_no_extra_traits! {
676+
// linux/net_tstamp.h
677+
#[allow(missing_debug_implementations)]
678+
pub struct sock_txtime {
679+
pub clockid: ::clockid_t,
680+
pub flags: ::__u32,
681+
}
682+
}
683+
}
684+
}
685+
673686
cfg_if! {
674687
if #[cfg(libc_union)] {
675688
s_no_extra_traits! {
@@ -2528,6 +2541,12 @@ pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
25282541
pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
25292542
pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
25302543
pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
2544+
cfg_if! {
2545+
if #[cfg(not(all(target_env = "musl", target_arch = "mips")))] {
2546+
pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
2547+
pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
2548+
}
2549+
}
25312550

25322551
// linux/if_alg.h
25332552
pub const ALG_SET_KEY: ::c_int = 1;

0 commit comments

Comments
 (0)