Skip to content

Commit

Permalink
hurd: fix definition of utsname struct
Browse files Browse the repository at this point in the history
- 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 <#3992>)
(cherry picked from commit 158cd30)
  • Loading branch information
pinotree authored and tgross35 committed Nov 6, 2024
1 parent 8ca43c6 commit 016dea7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/unix/hurd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
Expand Down

0 comments on commit 016dea7

Please sign in to comment.