summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2022-01-24 18:33:45 +0000
committerDavid Carlier <devnexen@gmail.com>2022-01-24 18:33:45 +0000
commit0ef1e7130d5f900b0f1c48ef5e65cf672283039d (patch)
tree3c808d24c40806f525f06e91d949158e9a132104 /src
parent157bcec987c6aee1538b73e90e01ea041b0d66d9 (diff)
downloadrust-libc-0ef1e7130d5f900b0f1c48ef5e65cf672283039d.tar.gz
netbsd add ifconf data
Diffstat (limited to 'src')
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index a7c2440f13..872403e377 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -575,6 +575,16 @@ s! {
pub descr_len: u32,
pub descr_str: [::c_char; 1],
}
+
+ pub struct ifreq {
+ pub _priv: [[::c_char; 6]; 24],
+ }
+
+ pub struct ifconf {
+ pub ifc_len: ::c_int,
+ #[cfg(libc_union)]
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ }
}
s_no_extra_traits! {
@@ -693,6 +703,12 @@ s_no_extra_traits! {
pub open: __c_anonymous_posix_spawn_fae_open,
pub dup2: __c_anonymous_posix_spawn_fae_dup2,
}
+
+ #[cfg(libc_union)]
+ pub union __c_anonymous_ifc_ifcu {
+ pub ifcu_buf: *mut ::c_void,
+ pub ifcu_req: *mut ifreq,
+ }
}
cfg_if! {
@@ -1155,6 +1171,41 @@ cfg_if! {
}
}
}
+
+ #[cfg(libc_union)]
+ impl Eq for __c_anonymous_ifc_ifcu {}
+
+ #[cfg(libc_union)]
+ impl PartialEq for __c_anonymous_ifc_ifcu {
+ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
+ unsafe {
+ self.ifcu_buf == other.ifcu_buf
+ || self.ifcu_req == other.ifcu_req
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ unsafe {
+ f.debug_struct("__c_anonymous_ifc_ifcu")
+ .field("ifcu_buf", &self.ifcu_buf)
+ .field("ifcu_req", &self.ifcu_req)
+ .finish()
+ }
+ }
+ }
+
+ #[cfg(libc_union)]
+ impl ::hash::Hash for __c_anonymous_ifc_ifcu {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ unsafe {
+ self.ifcu_buf.hash(state);
+ self.ifcu_req.hash(state);
+ }
+ }
+ }
}
}