use uint32_t for n_net in netent

This commit is contained in:
auronandace
2026-04-27 15:09:53 +01:00
parent a6df5229f4
commit df5deb2b59
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
# netinet/in.h brings in sys/socket.h
sys_includes = ["netinet/in.h", "features.h"]
sys_includes = ["inttypes.h", "netinet/in.h", "features.h"]
include_guard = "_RELIBC_NETDB_H"
trailer = """
#ifndef _RELIBC_BITS_NETDB_H
#define _RELIBC_BITS_NETDB_H
#define h_errno (*__h_errno_location())
#define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
#define h_addr h_addr_list[0] /* Address, for backward compatibility.*/
#endif // _RELIBC_BITS_NETDB_H
"""
+3 -3
View File
@@ -27,7 +27,7 @@ use crate::{
platform::{
self, Pal, Sys,
rlb::{Line, RawLineBuffer},
types::{c_char, c_int, c_ulong, c_void},
types::{c_char, c_int, c_void, uint32_t},
},
raw_cell::RawCell,
};
@@ -62,7 +62,7 @@ pub struct netent {
n_name: *mut c_char, /* official name of net */
n_aliases: *mut *mut c_char, /* alias list */
n_addrtype: c_int, /* net address type */
n_net: c_ulong, /* network # */
n_net: uint32_t, /* network # */
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netdb.h.html>.
@@ -512,7 +512,7 @@ pub unsafe extern "C" fn getnetent() -> *mut netent {
.cast::<c_char>(),
n_aliases: net_aliases.as_mut_slice().as_mut_ptr(),
n_addrtype: AF_INET,
n_net: c_ulong::from(NET_ADDR.unwrap()),
n_net: uint32_t::from(NET_ADDR.unwrap()),
}
};
(&raw mut NET_ENTRY).cast::<netent>()