From 016dea75af3c50dc5045a8b5dda18d7eaf66b1e8 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 20 Oct 2024 09:17:50 +0200 Subject: [PATCH] hurd: fix definition of utsname struct - drop the "domainname" field, as it is not actually used - add a private "_UTSNAME_LENGTH" constant matching the helper libc one, to ease declaring the struct - bump the size of the other fields to "_UTSNAME_LENGTH" (backport ) (cherry picked from commit 158cd3063c11415194e0dc6e90cdf5fdad8b86e5) --- src/unix/hurd/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/unix/hurd/mod.rs b/src/unix/hurd/mod.rs index db22ecce11d8d..ec22469a31693 100644 --- a/src/unix/hurd/mod.rs +++ b/src/unix/hurd/mod.rs @@ -873,12 +873,11 @@ s! { } pub struct utsname { - pub sysname: [::c_char; 65], - pub nodename: [::c_char; 65], - pub release: [::c_char; 65], - pub version: [::c_char; 65], - pub machine: [::c_char; 65], - pub domainname: [::c_char; 65] + pub sysname: [::c_char; _UTSNAME_LENGTH], + pub nodename: [::c_char; _UTSNAME_LENGTH], + pub release: [::c_char; _UTSNAME_LENGTH], + pub version: [::c_char; _UTSNAME_LENGTH], + pub machine: [::c_char; _UTSNAME_LENGTH], } pub struct rlimit64 { @@ -3437,6 +3436,9 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { }; pub const PTHREAD_STACK_MIN: ::size_t = 0; +// Non-public helper constants +const _UTSNAME_LENGTH: usize = 1024; + const_fn! { {const} fn CMSG_ALIGN(len: usize) -> usize { len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1)