Skip to content

Commit 0fa63b4

Browse files
committed
Add struct sock_txtime and related flags
These are needed to use the SO_TXTIME socket option on Linux, which is already exposed.
1 parent 39d69eb commit 0fa63b4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libc-test/semver/linux.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,8 @@ SOF_TIMESTAMPING_SOFTWARE
20202020
SOF_TIMESTAMPING_SYS_HARDWARE
20212021
SOF_TIMESTAMPING_TX_HARDWARE
20222022
SOF_TIMESTAMPING_TX_SOFTWARE
2023+
SOF_TXTIME_DEADLINE_MODE
2024+
SOF_TXTIME_REPORT_ERRORS
20232025
SOL_AAL
20242026
SOL_ALG
20252027
SOL_ATM
@@ -2996,6 +2998,7 @@ sigwaitinfo
29962998
sock_extended_err
29972999
sock_filter
29983000
sock_fprog
3001+
sock_txtime
29993002
sockaddr_alg
30003003
sockaddr_can
30013004
sockaddr_ll

src/unix/linux_like/linux/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ s! {
581581
pub nla_len: u16,
582582
pub nla_type: u16,
583583
}
584+
585+
// linux/net_tstamp.h
586+
#[cfg(not(all(target_env = "musl", target_arch = "mips")))]
587+
pub struct sock_txtime {
588+
pub clockid: ::clockid_t,
589+
pub flags: ::__u32,
590+
}
584591
}
585592

586593
s_no_extra_traits! {
@@ -2528,6 +2535,10 @@ pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
25282535
pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
25292536
pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
25302537
pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
2538+
#[cfg(not(all(target_env = "musl", target_arch = "mips")))]
2539+
pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
2540+
#[cfg(not(all(target_env = "musl", target_arch = "mips")))]
2541+
pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
25312542

25322543
// linux/if_alg.h
25332544
pub const ALG_SET_KEY: ::c_int = 1;

0 commit comments

Comments
 (0)