Skip to content

Commit 016dea7

Browse files
pinotreetgross35
authored andcommitted
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 <#3992>) (cherry picked from commit 158cd30)
1 parent 8ca43c6 commit 016dea7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/unix/hurd/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -873,12 +873,11 @@ s! {
873873
}
874874

875875
pub struct utsname {
876-
pub sysname: [::c_char; 65],
877-
pub nodename: [::c_char; 65],
878-
pub release: [::c_char; 65],
879-
pub version: [::c_char; 65],
880-
pub machine: [::c_char; 65],
881-
pub domainname: [::c_char; 65]
876+
pub sysname: [::c_char; _UTSNAME_LENGTH],
877+
pub nodename: [::c_char; _UTSNAME_LENGTH],
878+
pub release: [::c_char; _UTSNAME_LENGTH],
879+
pub version: [::c_char; _UTSNAME_LENGTH],
880+
pub machine: [::c_char; _UTSNAME_LENGTH],
882881
}
883882

884883
pub struct rlimit64 {
@@ -3437,6 +3436,9 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
34373436
};
34383437
pub const PTHREAD_STACK_MIN: ::size_t = 0;
34393438

3439+
// Non-public helper constants
3440+
const _UTSNAME_LENGTH: usize = 1024;
3441+
34403442
const_fn! {
34413443
{const} fn CMSG_ALIGN(len: usize) -> usize {
34423444
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)

0 commit comments

Comments
 (0)