diff options
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | libc-test/Cargo.toml | 4 | ||||
-rw-r--r-- | libc-test/build.rs | 10 | ||||
-rw-r--r-- | libc-test/semver/dragonfly.txt | 1 | ||||
-rw-r--r-- | libc-test/semver/freebsd.txt | 9 | ||||
-rw-r--r-- | libc-test/semver/linux.txt | 30 | ||||
-rw-r--r-- | libc-test/semver/netbsd.txt | 7 | ||||
-rw-r--r-- | libc-test/semver/openbsd.txt | 4 | ||||
-rw-r--r-- | libc-test/semver/redox.txt | 1 | ||||
-rw-r--r-- | libc-test/test/cmsg.rs | 21 | ||||
-rw-r--r-- | src/unix/aix/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/aix/powerpc64.rs | 23 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/dragonfly/mod.rs | 1 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 15 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/netbsd/mod.rs | 7 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/openbsd/mod.rs | 10 | ||||
-rw-r--r-- | src/unix/linux_like/linux/mod.rs | 63 | ||||
-rw-r--r-- | src/unix/redox/mod.rs | 3 |
18 files changed, 193 insertions, 20 deletions
diff --git a/Cargo.toml b/Cargo.toml index 3721096743..21b4e312bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.140" +version = "0.2.141" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 8cd125934a..d72311c4e2 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc-test" -version = "0.2.140" +version = "0.2.141" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" build = "build.rs" @@ -12,7 +12,7 @@ A test crate for the libc crate. [dependencies.libc] path = ".." -version = "0.2.140" +version = "0.2.141" default-features = false [build-dependencies] diff --git a/libc-test/build.rs b/libc-test/build.rs index 9536668f2f..ac0f996fc4 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2283,6 +2283,9 @@ fn test_freebsd(target: &str) { // FIXME: Removed in https://reviews.freebsd.org/D39127. "KERN_VNODE" => true, + // Added in FreeBSD 14 + "EV_KEEPUDATA" if Some(14) > freebsd_ver => true, + _ => false, } }); @@ -3391,7 +3394,7 @@ fn test_linux(target: &str) { } // FIXME(https://github.com/rust-lang/libc/issues/1558): passing by // value corrupts the value for reasons not understood. - if (gnu && sparc64) && ty == "ip_mreqn" { + if (gnu && sparc64) && (ty == "ip_mreqn" || ty == "hwtstamp_config") { return true; } match ty { @@ -3476,6 +3479,7 @@ fn test_linux(target: &str) { || name.starts_with("P_") || name.starts_with("PF_") || name.starts_with("RLIMIT_") + || name.starts_with("RTEXT_FILTER_") || name.starts_with("SOL_") || name.starts_with("STATX_") || name.starts_with("SW_") @@ -3490,6 +3494,7 @@ fn test_linux(target: &str) { if musl || sparc64 { // FIXME: Requires >= 5.4.1 kernel headers if name.starts_with("J1939") + || name.starts_with("RTEXT_FILTER_") || name.starts_with("SO_J1939") || name.starts_with("SCM_J1939") { @@ -3719,6 +3724,9 @@ fn test_linux(target: &str) { => true, "SCTP_FUTURE_ASSOC" | "SCTP_CURRENT_ASSOC" | "SCTP_ALL_ASSOC" | "SCTP_PEER_ADDR_THLDS_V2" => true, // linux 5.5+ + // FIXME: Requires more recent kernel headers + "HWTSTAMP_TX_ONESTEP_P2P" if sparc64 || musl => true, // linux v5.6+ + _ => false, } }); diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 115c2919af..23c66c3298 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -269,6 +269,7 @@ EV_ENABLE EV_EOF EV_ERROR EV_FLAG1 +EV_HUP EV_NODATA EV_ONESHOT EV_RECEIPT diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 429ae63eb8..eadb4e9c73 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -307,6 +307,9 @@ EV_ENABLE EV_EOF EV_ERROR EV_FLAG1 +EV_FLAG2 +EV_FORCEONESHOT +EV_KEEPUDATA EV_ONESHOT EV_RECEIPT EV_SYSFLAGS @@ -791,8 +794,11 @@ NI_NUMERICSERV NOEXPR NOKERNINFO NOSTR +NOTE_ABSTIME NOTE_ATTRIB NOTE_CHILD +NOTE_CLOSE +NOTE_CLOSE_WRITE NOTE_DELETE NOTE_EXEC NOTE_EXIT @@ -803,13 +809,16 @@ NOTE_FFCTRLMASK NOTE_FFLAGSMASK NOTE_FFNOP NOTE_FFOR +NOTE_FILE_POLL NOTE_FORK NOTE_LINK NOTE_LOWAT NOTE_MSECONDS NOTE_NSECONDS +NOTE_OPEN NOTE_PCTRLMASK NOTE_PDATAMASK +NOTE_READ NOTE_RENAME NOTE_REVOKE NOTE_SECONDS diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index 95f8178e5e..178f76d946 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -818,6 +818,26 @@ GLOB_NOSPACE GRND_NONBLOCK GRND_RANDOM GRND_INSECURE +HWTSTAMP_TX_OFF +HWTSTAMP_TX_ON +HWTSTAMP_TX_ONESTEP_SYNC +HWTSTAMP_TX_ONESTEP_P2P +HWTSTAMP_FILTER_NONE +HWTSTAMP_FILTER_ALL +HWTSTAMP_FILTER_SOME +HWTSTAMP_FILTER_PTP_V1_L4_EVENT +HWTSTAMP_FILTER_PTP_V1_L4_SYNC +HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ +HWTSTAMP_FILTER_PTP_V2_L4_EVENT +HWTSTAMP_FILTER_PTP_V2_L4_SYNC +HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ +HWTSTAMP_FILTER_PTP_V2_L2_EVENT +HWTSTAMP_FILTER_PTP_V2_L2_SYNC +HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ +HWTSTAMP_FILTER_PTP_V2_EVENT +HWTSTAMP_FILTER_PTP_V2_SYNC +HWTSTAMP_FILTER_PTP_V2_DELAY_REQ +HWTSTAMP_FILTER_NTP_ALL IBSHIFT IFA_ADDRESS IFA_ANYCAST @@ -2047,6 +2067,13 @@ RTCF_LOG RTCF_MASQ RTCF_NAT RTCF_VALVE +RTEXT_FILTER_BRVLAN +RTEXT_FILTER_BRVLAN_COMPRESSED +RTEXT_FILTER_CFM_CONFIG +RTEXT_FILTER_CFM_STATUS +RTEXT_FILTER_MRP +RTEXT_FILTER_SKIP_STATS +RTEXT_FILTER_VF RTF_ADDRCLASSMASK RTF_ADDRCONF RTF_ALLONLINK @@ -2309,6 +2336,7 @@ SIOCDIFADDR SIOCDRARP SIOCETHTOOL SIOCGARP +SIOCGHWTSTAMP SIOCGIFADDR SIOCGIFBR SIOCGIFBRDADDR @@ -2334,6 +2362,7 @@ SIOGIFINDEX SIOCGMIIPHY SIOCGMIIREG SIOCSARP +SIOCSHWTSTAMP SIOCSIFADDR SIOCSIFBR SIOCSIFBRDADDR @@ -3121,6 +3150,7 @@ getspnam_r gettid getxattr hasmntopt +hwtstamp_config iconv iconv_close iconv_open diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 174396c720..3dc84da635 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -730,6 +730,12 @@ NOTE_DELETE NOTE_EXEC NOTE_EXIT NOTE_EXTEND +NOTE_FFAND +NOTE_FFCOPY +NOTE_FFCTRLMASK +NOTE_FFLAGSMASK +NOTE_FFNOP +NOTE_FFOR NOTE_FORK NOTE_LINK NOTE_LOWAT @@ -741,6 +747,7 @@ NOTE_RENAME NOTE_REVOKE NOTE_TRACK NOTE_TRACKERR +NOTE_TRIGGER NOTE_USECONDS NOTE_WRITE NTP_API diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index bf0a838280..d95190ee8c 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -176,6 +176,8 @@ ESOCKTNOSUPPORT ETOOMANYREFS EUSERS EVFILT_AIO +EVFILT_DEVICE +EVFILT_EXCEPT EVFILT_PROC EVFILT_READ EVFILT_SIGNAL @@ -582,6 +584,7 @@ NOEXPR NOKERNINFO NOSTR NOTE_ATTRIB +NOTE_CHANGE NOTE_CHILD NOTE_DELETE NOTE_EOF @@ -591,6 +594,7 @@ NOTE_EXTEND NOTE_FORK NOTE_LINK NOTE_LOWAT +NOTE_OOB NOTE_PCTRLMASK NOTE_PDATAMASK NOTE_RENAME diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt index 7751939311..c8f5d400c5 100644 --- a/libc-test/semver/redox.txt +++ b/libc-test/semver/redox.txt @@ -204,6 +204,7 @@ open_wmemstream pipe2 pthread_condattr_setclock qsort +reallocarray setrlimit setservent strcasecmp diff --git a/libc-test/test/cmsg.rs b/libc-test/test/cmsg.rs index 00c3c14f4c..baef3902d6 100644 --- a/libc-test/test/cmsg.rs +++ b/libc-test/test/cmsg.rs @@ -57,29 +57,30 @@ mod t { #[test] fn test_cmsg_nxthdr() { use std::ptr; + // Helps to align the buffer on the stack. + #[repr(align(8))] + struct Align8<T>(T); - let mut buffer = [0u8; 256]; + const CAPACITY: usize = 512; + let mut buffer = Align8([0_u8; CAPACITY]); let mut mhdr: msghdr = unsafe { mem::zeroed() }; - let pmhdr = &mhdr as *const msghdr; for start_ofs in 0..64 { - let pcmsghdr = &mut buffer[start_ofs] as *mut u8 as *mut cmsghdr; + let pcmsghdr = buffer.0.as_mut_ptr().cast::<cmsghdr>(); mhdr.msg_control = pcmsghdr as *mut c_void; mhdr.msg_controllen = (160 - start_ofs) as _; for cmsg_len in 0..64 { for next_cmsg_len in 0..32 { - for i in buffer[start_ofs..].iter_mut() { - *i = 0; - } unsafe { + pcmsghdr.cast::<u8>().write_bytes(0, CAPACITY); (*pcmsghdr).cmsg_len = cmsg_len; - let libc_next = libc::CMSG_NXTHDR(pmhdr, pcmsghdr); - let next = cmsg_nxthdr(pmhdr, pcmsghdr); + let libc_next = libc::CMSG_NXTHDR(&mhdr, pcmsghdr); + let next = cmsg_nxthdr(&mhdr, pcmsghdr); assert_eq!(libc_next, next); if libc_next != ptr::null_mut() { (*libc_next).cmsg_len = next_cmsg_len; - let libc_next = libc::CMSG_NXTHDR(pmhdr, pcmsghdr); - let next = cmsg_nxthdr(pmhdr, pcmsghdr); + let libc_next = libc::CMSG_NXTHDR(&mhdr, pcmsghdr); + let next = cmsg_nxthdr(&mhdr, pcmsghdr); assert_eq!(libc_next, next); } } diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 3348ead5b6..98a09b5abc 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -2054,7 +2054,7 @@ f! { ::mem::size_of::<::cmsghdr>() as ::c_uint + length } - pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { ::mem::size_of::<::cmsghdr>() as ::c_uint + length } diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs index 1f96ae37ad..6c6b87db74 100644 --- a/src/unix/aix/powerpc64.rs +++ b/src/unix/aix/powerpc64.rs @@ -192,6 +192,29 @@ s_no_extra_traits! { } } +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + #[cfg(libc_union)] + pub unsafe fn si_value(&self) -> ::sigval { + self.si_value + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.si_status + } +} + cfg_if! { if #[cfg(feature = "extra_traits")] { #[cfg(libc_union)] diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 70fe6e2edd..63c0594f41 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1091,6 +1091,7 @@ pub const EV_NODATA: u16 = 0x1000; pub const EV_FLAG1: u16 = 0x2000; pub const EV_ERROR: u16 = 0x4000; pub const EV_EOF: u16 = 0x8000; +pub const EV_HUP: u16 = 0x8000; pub const EV_SYSFLAGS: u16 = 0xf000; pub const FIODNAME: ::c_ulong = 0x80106678; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index b70a40f15d..55b520faab 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2693,15 +2693,20 @@ pub const EV_ADD: u16 = 0x1; pub const EV_DELETE: u16 = 0x2; pub const EV_ENABLE: u16 = 0x4; pub const EV_DISABLE: u16 = 0x8; +pub const EV_FORCEONESHOT: u16 = 0x100; +pub const EV_KEEPUDATA: u16 = 0x200; + pub const EV_ONESHOT: u16 = 0x10; pub const EV_CLEAR: u16 = 0x20; pub const EV_RECEIPT: u16 = 0x40; pub const EV_DISPATCH: u16 = 0x80; +pub const EV_SYSFLAGS: u16 = 0xf000; pub const EV_DROP: u16 = 0x1000; pub const EV_FLAG1: u16 = 0x2000; -pub const EV_ERROR: u16 = 0x4000; +pub const EV_FLAG2: u16 = 0x4000; + pub const EV_EOF: u16 = 0x8000; -pub const EV_SYSFLAGS: u16 = 0xf000; +pub const EV_ERROR: u16 = 0x4000; pub const NOTE_TRIGGER: u32 = 0x01000000; pub const NOTE_FFNOP: u32 = 0x00000000; @@ -2711,6 +2716,7 @@ pub const NOTE_FFCOPY: u32 = 0xc0000000; pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_FILE_POLL: u32 = 0x00000002; pub const NOTE_DELETE: u32 = 0x00000001; pub const NOTE_WRITE: u32 = 0x00000002; pub const NOTE_EXTEND: u32 = 0x00000004; @@ -2718,6 +2724,10 @@ pub const NOTE_ATTRIB: u32 = 0x00000008; pub const NOTE_LINK: u32 = 0x00000010; pub const NOTE_RENAME: u32 = 0x00000020; pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_OPEN: u32 = 0x00000080; +pub const NOTE_CLOSE: u32 = 0x00000100; +pub const NOTE_CLOSE_WRITE: u32 = 0x00000200; +pub const NOTE_READ: u32 = 0x00000400; pub const NOTE_EXIT: u32 = 0x80000000; pub const NOTE_FORK: u32 = 0x40000000; pub const NOTE_EXEC: u32 = 0x20000000; @@ -2730,6 +2740,7 @@ pub const NOTE_SECONDS: u32 = 0x00000001; pub const NOTE_MSECONDS: u32 = 0x00000002; pub const NOTE_USECONDS: u32 = 0x00000004; pub const NOTE_NSECONDS: u32 = 0x00000008; +pub const NOTE_ABSTIME: u32 = 0x00000010; pub const MADV_PROTECT: ::c_int = 10; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 87132e2587..fd7175583e 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1986,6 +1986,13 @@ pub const EV_ERROR: u32 = 0x4000; pub const EV_EOF: u32 = 0x8000; pub const EV_SYSFLAGS: u32 = 0xf000; +pub const NOTE_TRIGGER: u32 = 0x01000000; +pub const NOTE_FFNOP: u32 = 0x00000000; +pub const NOTE_FFAND: u32 = 0x40000000; +pub const NOTE_FFOR: u32 = 0x80000000; +pub const NOTE_FFCOPY: u32 = 0xc0000000; +pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; +pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; pub const NOTE_LOWAT: u32 = 0x00000001; pub const NOTE_DELETE: u32 = 0x00000001; pub const NOTE_WRITE: u32 = 0x00000002; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 192413a54a..7f8f9400df 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1279,13 +1279,15 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4; pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP; +pub const EVFILT_READ: i16 = -1; +pub const EVFILT_WRITE: i16 = -2; pub const EVFILT_AIO: i16 = -3; +pub const EVFILT_VNODE: i16 = -4; pub const EVFILT_PROC: i16 = -5; -pub const EVFILT_READ: i16 = -1; pub const EVFILT_SIGNAL: i16 = -6; pub const EVFILT_TIMER: i16 = -7; -pub const EVFILT_VNODE: i16 = -4; -pub const EVFILT_WRITE: i16 = -2; +pub const EVFILT_DEVICE: i16 = -8; +pub const EVFILT_EXCEPT: i16 = -9; pub const EV_ADD: u16 = 0x1; pub const EV_DELETE: u16 = 0x2; @@ -1304,6 +1306,7 @@ pub const EV_SYSFLAGS: u16 = 0xf800; pub const NOTE_LOWAT: u32 = 0x00000001; pub const NOTE_EOF: u32 = 0x00000002; +pub const NOTE_OOB: u32 = 0x00000004; pub const NOTE_DELETE: u32 = 0x00000001; pub const NOTE_WRITE: u32 = 0x00000002; pub const NOTE_EXTEND: u32 = 0x00000004; @@ -1320,6 +1323,7 @@ pub const NOTE_PCTRLMASK: u32 = 0xf0000000; pub const NOTE_TRACK: u32 = 0x00000001; pub const NOTE_TRACKERR: u32 = 0x00000002; pub const NOTE_CHILD: u32 = 0x00000004; +pub const NOTE_CHANGE: u32 = 0x00000001; pub const TMP_MAX: ::c_uint = 0x7fffffff; diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 36b2d7878e..a982901113 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -798,6 +798,12 @@ s_no_extra_traits! { #[cfg(not(libc_union))] pub ifr_ifru: ::sockaddr, } + + pub struct hwtstamp_config { + pub flags: ::c_int, + pub tx_type: ::c_int, + pub rx_filter: ::c_int, + } } s_no_extra_traits! { @@ -1221,6 +1227,31 @@ cfg_if! { .finish() } } + + impl ::fmt::Debug for hwtstamp_config { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("hwtstamp_config") + .field("flags", &self.flags) + .field("tx_type", &self.tx_type) + .field("rx_filter", &self.rx_filter) + .finish() + } + } + impl PartialEq for hwtstamp_config { + fn eq(&self, other: &hwtstamp_config) -> bool { + self.flags == other.flags && + self.tx_type == other.tx_type && + self.rx_filter == other.rx_filter + } + } + impl Eq for hwtstamp_config {} + impl ::hash::Hash for hwtstamp_config { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.flags.hash(state); + self.tx_type.hash(state); + self.rx_filter.hash(state); + } + } } } @@ -2771,6 +2802,8 @@ pub const SIOCGRARP: ::c_ulong = 0x00008961; pub const SIOCSRARP: ::c_ulong = 0x00008962; pub const SIOCGIFMAP: ::c_ulong = 0x00008970; pub const SIOCSIFMAP: ::c_ulong = 0x00008971; +pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0; +pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1; pub const IPTOS_TOS_MASK: u8 = 0x1E; pub const IPTOS_PREC_MASK: u8 = 0xE0; @@ -3042,6 +3075,14 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02; pub const ARPD_FLUSH: ::c_ushort = 0x03; pub const ATF_MAGIC: ::c_int = 0x80; +pub const RTEXT_FILTER_VF: ::c_int = 1 << 0; +pub const RTEXT_FILTER_BRVLAN: ::c_int = 1 << 1; +pub const RTEXT_FILTER_BRVLAN_COMPRESSED: ::c_int = 1 << 2; +pub const RTEXT_FILTER_SKIP_STATS: ::c_int = 1 << 3; +pub const RTEXT_FILTER_MRP: ::c_int = 1 << 4; +pub const RTEXT_FILTER_CFM_CONFIG: ::c_int = 1 << 5; +pub const RTEXT_FILTER_CFM_STATUS: ::c_int = 1 << 6; + // userspace compat definitions for RTNLGRP_* pub const RTMGRP_LINK: ::c_int = 0x00001; pub const RTMGRP_NOTIFY: ::c_int = 0x00002; @@ -3121,6 +3162,28 @@ pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14; pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0; pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1; +pub const HWTSTAMP_TX_OFF: ::c_uint = 0; +pub const HWTSTAMP_TX_ON: ::c_uint = 1; +pub const HWTSTAMP_TX_ONESTEP_SYNC: ::c_uint = 2; +pub const HWTSTAMP_TX_ONESTEP_P2P: ::c_uint = 3; + +pub const HWTSTAMP_FILTER_NONE: ::c_uint = 0; +pub const HWTSTAMP_FILTER_ALL: ::c_uint = 1; +pub const HWTSTAMP_FILTER_SOME: ::c_uint = 2; +pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: ::c_uint = 3; +pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: ::c_uint = 4; +pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: ::c_uint = 5; +pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: ::c_uint = 6; +pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: ::c_uint = 7; +pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: ::c_uint = 8; +pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: ::c_uint = 9; +pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: ::c_uint = 10; +pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: ::c_uint = 11; +pub const HWTSTAMP_FILTER_PTP_V2_EVENT: ::c_uint = 12; +pub const HWTSTAMP_FILTER_PTP_V2_SYNC: ::c_uint = 13; +pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14; +pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15; + // linux/if_alg.h pub const ALG_SET_KEY: ::c_int = 1; pub const ALG_SET_IV: ::c_int = 2; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index f1bc9cc543..6661ea7358 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1043,6 +1043,9 @@ extern "C" { pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + // stdlib.h + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + // string.h pub fn strlcat(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t; pub fn strlcpy(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t; |