Skip to content

Commit

Permalink
fix(abi): use c_char for C strings
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed May 7, 2024
1 parent bf10a26 commit 3dbc0ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hermit-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub struct in6_addr {
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
pub sa_data: [c_char; 14],
}

#[repr(C)]
Expand All @@ -211,7 +211,7 @@ pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [u8; 8],
pub sin_zero: [c_char; 8],
}

#[repr(C)]
Expand All @@ -233,7 +233,7 @@ pub struct addrinfo {
pub ai_socktype: i32,
pub ai_protocol: i32,
pub ai_addrlen: socklen_t,
pub ai_canonname: *mut u8,
pub ai_canonname: *mut c_char,
pub ai_addr: *mut sockaddr,
pub ai_next: *mut addrinfo,
}
Expand Down Expand Up @@ -323,7 +323,7 @@ pub struct dirent64 {
/// File type
pub d_type: u8,
/// Filename (null-terminated)
pub d_name: [u8; 256],
pub d_name: [c_char; 256],
}

pub const DT_UNKNOWN: u8 = 0;
Expand Down Expand Up @@ -761,8 +761,8 @@ extern "C" {

#[link_name = "sys_getaddrinfo"]
pub fn getaddrinfo(
nodename: *const i8,
servname: *const u8,
nodename: *const c_char,
servname: *const c_char,
hints: *const addrinfo,
res: *mut *mut addrinfo,
) -> i32;
Expand Down

0 comments on commit 3dbc0ee

Please sign in to comment.