From ca7e96a9e41b94265658107162c28b53dfe49a9c Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Thu, 30 May 2024 01:06:33 +0200 Subject: [PATCH 1/4] Change ifa_flags type to u64 for Solaris/illumos (backport ) (cherry picked from commit efc67c98da35d69c7ff33ee70aec20459cb58401) --- src/unix/solarish/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 7ed00413dc7f2..160cf66947a94 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -135,7 +135,7 @@ s! { pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut ::c_char, - pub ifa_flags: ::c_ulong, + pub ifa_flags: u64, pub ifa_addr: *mut ::sockaddr, pub ifa_netmask: *mut ::sockaddr, pub ifa_dstaddr: *mut ::sockaddr, From 18210cade2b62ec8f60cae3e36ce827b6d20d81a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 7 Jun 2024 02:57:34 +0200 Subject: [PATCH 2/4] hurd: Add XATTR_CREATE, XATTR_REPLACE (backport ) (cherry picked from commit 9d33ec2fbf270940f9f5549b386ee4e39fadb147) --- src/unix/hurd/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index 2701649f6c646..71f1ac8d98c22 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -2760,6 +2760,10 @@ pub const MREMAP_FIXED: ::c_int = 2; pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; +// sys/xattr.h +pub const XATTR_CREATE: ::c_int = 0x1; +pub const XATTR_REPLACE: ::c_int = 0x2; + // spawn.h pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; pub const POSIX_SPAWN_SETSID: ::c_int = 128; From 98f13d93743a542b3579ed131ec9c9dee72e238d Mon Sep 17 00:00:00 2001 From: B I Mohammed Abbas Date: Fri, 28 Jun 2024 17:31:53 +0530 Subject: [PATCH 3/4] Adding constant SOMAXCONN to vxworks (backport ) (cherry picked from commit 9d5b5a7d0c28790a436657d7476528aa70816440) --- src/vxworks/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index c248c64da5012..4f0274241394e 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -797,6 +797,7 @@ pub const S_IRWXO: ::c_int = 0x0007; // socket.h pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SOMAXCONN: ::c_int = 128; pub const SO_DEBUG: ::c_int = 0x0001; pub const SO_REUSEADDR: ::c_int = 0x0004; From 16431da31f4d99220fc20db4cb0acefaa32d2f5a Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 5 Aug 2024 18:32:01 -0400 Subject: [PATCH 4/4] Modify QNX NTO platform support Modify QNX NTO `dl_iterate_phdr` to toke `* mut` All other platforms use `* mut`, and while this is technically a breaking change, most likely noone is using it directly. NTO does not define last four fields of the `dl_phdr_info`, so might as well exclude them for cleanliness. v7.0: [link](https://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html) v7.1: [link](https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html) v8.0: [link](https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html?hl=dl_phdr_info) See also https://github.com/rust-lang/backtrace-rs/pull/648 (backport ) (cherry picked from commit 4edd2660c451dbef87b7b6b5f2f555bc84553882) --- src/unix/linux_like/linux/mod.rs | 9 +++++---- src/unix/nto/mod.rs | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index eb1b18375403f..700b6fd0d408e 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -327,13 +327,14 @@ s! { // to false. So I'm just removing these, and if uClibc changes // the #if block in the future to include the following fields, these // will probably need including here. tsidea, skrap - #[cfg(not(target_env = "uclibc"))] + // QNX (NTO) platform does not define these fields + #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] pub dlpi_adds: ::c_ulonglong, - #[cfg(not(target_env = "uclibc"))] + #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] pub dlpi_subs: ::c_ulonglong, - #[cfg(not(target_env = "uclibc"))] + #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] pub dlpi_tls_modid: ::size_t, - #[cfg(not(target_env = "uclibc"))] + #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] pub dlpi_tls_data: *mut ::c_void, } diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index 73fd2ba9f49fc..001b51a7da678 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -3340,7 +3340,10 @@ extern "C" { pub fn dl_iterate_phdr( callback: ::Option< unsafe extern "C" fn( - info: *const dl_phdr_info, + // The original .h file declares this as *const, but for consistency with other platforms, + // changing this to *mut to make it easier to use. + // Maybe in v0.3 all platforms should use this as a *const. + info: *mut dl_phdr_info, size: ::size_t, data: *mut ::c_void, ) -> ::c_int,