Skip to content

Commit

Permalink
fix: FreeBSD kld_load() (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzania authored Nov 30, 2023
1 parent d0caf49 commit 8d5a85c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bsd/ifconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
os::fd::AsRawFd,
};

use libc::kld_load;
use libc::{c_char, kld_load};
use nix::{ioctl_readwrite, ioctl_write_ptr, sys::socket::AddressFamily};

use super::{
Expand Down Expand Up @@ -49,7 +49,8 @@ impl IfReq {
let mod_name = format!("if_{if_name}");
unsafe {
// Ignore the return value for the time being.
kld_load(mod_name.as_ptr());
// Do the cast because `c_char` differs across platforms.
kld_load(mod_name.as_ptr() as *const c_char);
}

Self {
Expand Down

0 comments on commit 8d5a85c

Please sign in to comment.