From 4646be7a6bdc39fbf404ad3f1eb290f41237f60a Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 12 Feb 2022 20:43:17 -0500 Subject: [PATCH] Fix uid_t and gid_t sizes on horizon (cherry picked from commit e84dbb7cb3a015c9f33db9b29019975c669113de) --- src/unix/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 5ff2294e..52508345 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -23,13 +23,21 @@ pub type uintptr_t = usize; pub type ssize_t = isize; pub type pid_t = i32; -pub type uid_t = u32; -pub type gid_t = u32; pub type in_addr_t = u32; pub type in_port_t = u16; pub type sighandler_t = ::size_t; pub type cc_t = ::c_uchar; +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub type uid_t = ::c_ushort; + pub type gid_t = ::c_ushort; + } else { + pub type uid_t = u32; + pub type gid_t = u32; + } +} + #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum DIR {} impl ::Copy for DIR {}