From a2ac992346f8e08284d79d91e15ef2f81fbbcf6b Mon Sep 17 00:00:00 2001 From: David Koloski Date: Tue, 9 Apr 2024 16:50:05 +0000 Subject: [PATCH 1/2] Correct types of mode bit constants on Fuchsia Fuchsia's definitions of these constants were split from the unix impls before #503, and so S_ISUID, S_ISGID, and S_ISVTX are all incorrectly typed as c_int instead of mode_t. This applies the same fix to Fuchsia's constant definitions to bring them in line with the rest of libc. --- src/fuchsia/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index b9cdafbe8cb18..f659c9362b410 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -1334,9 +1334,9 @@ pub const GRPQUOTA: ::c_int = 1; pub const SIGIOT: ::c_int = 6; -pub const S_ISUID: ::c_int = 0x800; -pub const S_ISGID: ::c_int = 0x400; -pub const S_ISVTX: ::c_int = 0x200; +pub const S_ISUID: ::mode_t = 0x800; +pub const S_ISGID: ::mode_t = 0x400; +pub const S_ISVTX: ::mode_t = 0x200; pub const IF_NAMESIZE: ::size_t = 16; pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; From 0338155989f3230be5733248ffbe0c347d7ceb8a Mon Sep 17 00:00:00 2001 From: David Koloski Date: Tue, 9 Apr 2024 16:45:31 -0400 Subject: [PATCH 2/2] Update src/fuchsia/mod.rs Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- src/fuchsia/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index f659c9362b410..ba19e0c4c423f 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -1334,9 +1334,9 @@ pub const GRPQUOTA: ::c_int = 1; pub const SIGIOT: ::c_int = 6; -pub const S_ISUID: ::mode_t = 0x800; -pub const S_ISGID: ::mode_t = 0x400; -pub const S_ISVTX: ::mode_t = 0x200; +pub const S_ISUID: ::mode_t = 0o4000; +pub const S_ISGID: ::mode_t = 0o2000; +pub const S_ISVTX: ::mode_t = 0o1000; pub const IF_NAMESIZE: ::size_t = 16; pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;