Skip to content

Commit 50719a3

Browse files
committed
Auto merge of #1105 - gz:fix-timestamping, r=gnzlbg
Added SOF_TIMESTAMPING, fix too narrow scoping for SO_TIMESTAMPING. Fixes issues raised in #1104 and #1103.
2 parents aee584c + 01feb16 commit 50719a3

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ fn main() {
285285
cfg.header("linux/seccomp.h");
286286
cfg.header("linux/if_ether.h");
287287
cfg.header("linux/if_tun.h");
288+
cfg.header("linux/net_tstamp.h");
288289
// DCCP support
289290
if !uclibc && !musl && !emscripten {
290291
cfg.header("linux/dccp.h");

src/unix/notbsd/linux/mips/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,6 @@ pub const SO_PASSSEC: ::c_int = 34;
397397
pub const SO_TIMESTAMPNS: ::c_int = 35;
398398
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
399399
pub const SO_MARK: ::c_int = 36;
400-
pub const SO_TIMESTAMPING: ::c_int = 37;
401-
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
402400
pub const SO_RXQ_OVFL: ::c_int = 40;
403401
pub const SO_WIFI_STATUS: ::c_int = 41;
404402
pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;

src/unix/notbsd/linux/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,10 +1672,25 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02;
16721672
pub const ARPD_FLUSH: ::c_ushort = 0x03;
16731673
pub const ATF_MAGIC: ::c_int = 0x80;
16741674

1675+
#[cfg(not(target_arch = "sparc64"))]
1676+
pub const SO_TIMESTAMPING: ::c_int = 37;
1677+
#[cfg(target_arch = "sparc64")]
1678+
pub const SO_TIMESTAMPING: ::c_int = 35;
1679+
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
1680+
16751681
// linux/module.h
16761682
pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
16771683
pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002;
16781684

1685+
// linux/net_tstamp.h
1686+
pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0;
1687+
pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1;
1688+
pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2;
1689+
pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
1690+
pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
1691+
pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
1692+
pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
1693+
16791694
f! {
16801695
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
16811696
for slot in cpuset.bits.iter_mut() {

src/unix/notbsd/linux/other/b64/aarch64.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ pub const SO_PASSSEC: ::c_int = 34;
284284
pub const SO_TIMESTAMPNS: ::c_int = 35;
285285
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
286286
pub const SO_MARK: ::c_int = 36;
287-
pub const SO_TIMESTAMPING: ::c_int = 37;
288-
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
289287
pub const SO_PROTOCOL: ::c_int = 38;
290288
pub const SO_DOMAIN: ::c_int = 39;
291289
pub const SO_RXQ_OVFL: ::c_int = 40;

src/unix/notbsd/linux/other/b64/powerpc64.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ pub const SO_PASSSEC: ::c_int = 34;
271271
pub const SO_TIMESTAMPNS: ::c_int = 35;
272272
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
273273
pub const SO_MARK: ::c_int = 36;
274-
pub const SO_TIMESTAMPING: ::c_int = 37;
275-
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
276274
pub const SO_PROTOCOL: ::c_int = 38;
277275
pub const SO_DOMAIN: ::c_int = 39;
278276
pub const SO_RXQ_OVFL: ::c_int = 40;

src/unix/notbsd/linux/other/b64/x86_64.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ pub const SO_PASSSEC: ::c_int = 34;
371371
pub const SO_TIMESTAMPNS: ::c_int = 35;
372372
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
373373
pub const SO_MARK: ::c_int = 36;
374-
pub const SO_TIMESTAMPING: ::c_int = 37;
375-
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
376374
pub const SO_PROTOCOL: ::c_int = 38;
377375
pub const SO_DOMAIN: ::c_int = 39;
378376
pub const SO_RXQ_OVFL: ::c_int = 40;

0 commit comments

Comments
 (0)