`libc::sysctl` is missing
Hi, sysctl is missing. I am using this function to get the MTU of the interface. May I ask to add this function?
Are you using Linux? If so, the sysctl function is deprecated, and the Linux maintainers suggest you use the /proc/sys interface instead.
Are you using Linux? If so, the
sysctlfunction is deprecated, and the Linux maintainers suggest you use the /proc/sys interface instead.
I am using MacOS, and I need something like
let mut mib = [CTL_NET, AF_ROUTE, 0, AF_UNSPEC, NET_RT_IFLIST, idx as i32];
let mut len: size_t = 0;
if rustix::sysctl(mib.as_mut_ptr(), 6, null_mut(), &mut len, null_mut(), 0) < 0 {
return Err(io::Error::last_os_error());
}
Now, I am not quite sure whether the sysctl is necessary for rustix or not, currently, the BSD-like platform uses libc as the backend. The crates depend on rustix can use the feature gate to use libc on the BDS-like platform.