Skip to content

Commit

Permalink
add dummy syscall getaddrbyname if the feature DNS isn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed May 21, 2024
1 parent 01f66ce commit a9a2f96
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/syscalls/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,23 @@ pub struct linger {
pub l_linger: i32,
}

#[cfg(not(feature = "dns"))]
#[hermit_macro::system]
pub unsafe extern "C" fn sys_getaddrbyname(
_name: *const c_char,
_inaddr: *mut u8,
_len: usize,
) -> i32 {
-ENOSYS
}

#[cfg(feature = "dns")]
#[hermit_macro::system]
pub extern "C" fn sys_getaddrbyname(name: *const c_char, inaddr: *mut u8, len: usize) -> i32 {
pub unsafe extern "C" fn sys_getaddrbyname(
name: *const c_char,
inaddr: *mut u8,
len: usize,
) -> i32 {
use alloc::borrow::ToOwned;

use smoltcp::wire::DnsQueryType;
Expand Down

0 comments on commit a9a2f96

Please sign in to comment.