summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-05-28 13:23:22 +0200
committergnzlbg <gonzalobg88@gmail.com>2019-05-28 16:01:26 +0200
commit05caeabe91a348c1d84e6ecbd151076fd74344ef (patch)
treecdfa184c7b0d00dd73f462ba827463d236265310
parent5ede8aab947b9c9ec4f49250190ede33b86e00c4 (diff)
downloadrust-libc-05caeabe91a348c1d84e6ecbd151076fd74344ef.tar.gz
[breaking change] sockaddr_nl is not available on emscripten
-rw-r--r--src/unix/notbsd/android/mod.rs32
-rw-r--r--src/unix/notbsd/linux/mod.rs32
-rw-r--r--src/unix/notbsd/mod.rs32
3 files changed, 64 insertions, 32 deletions
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index bab0218b6b..99304e1f3c 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -201,6 +201,13 @@ s! {
}
s_no_extra_traits!{
+ pub struct sockaddr_nl {
+ pub nl_family: ::sa_family_t,
+ nl_pad: ::c_ushort,
+ pub nl_pid: u32,
+ pub nl_groups: u32
+ }
+
pub struct dirent {
pub d_ino: u64,
pub d_off: i64,
@@ -261,6 +268,31 @@ s_no_extra_traits!{
cfg_if! {
if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for sockaddr_nl {
+ fn eq(&self, other: &sockaddr_nl) -> bool {
+ self.nl_family == other.nl_family &&
+ self.nl_pid == other.nl_pid &&
+ self.nl_groups == other.nl_groups
+ }
+ }
+ impl Eq for sockaddr_nl {}
+ impl ::fmt::Debug for sockaddr_nl {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_nl")
+ .field("nl_family", &self.nl_family)
+ .field("nl_pid", &self.nl_pid)
+ .field("nl_groups", &self.nl_groups)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for sockaddr_nl {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.nl_family.hash(state);
+ self.nl_pid.hash(state);
+ self.nl_groups.hash(state);
+ }
+ }
+
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index f9f7a1067f..1e13d1bf3b 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -477,6 +477,13 @@ s! {
}
s_no_extra_traits!{
+ pub struct sockaddr_nl {
+ pub nl_family: ::sa_family_t,
+ nl_pad: ::c_ushort,
+ pub nl_pid: u32,
+ pub nl_groups: u32
+ }
+
pub struct dirent {
pub d_ino: ::ino_t,
pub d_off: ::off_t,
@@ -535,6 +542,31 @@ s_no_extra_traits!{
cfg_if! {
if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for sockaddr_nl {
+ fn eq(&self, other: &sockaddr_nl) -> bool {
+ self.nl_family == other.nl_family &&
+ self.nl_pid == other.nl_pid &&
+ self.nl_groups == other.nl_groups
+ }
+ }
+ impl Eq for sockaddr_nl {}
+ impl ::fmt::Debug for sockaddr_nl {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_nl")
+ .field("nl_family", &self.nl_family)
+ .field("nl_pid", &self.nl_pid)
+ .field("nl_groups", &self.nl_groups)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for sockaddr_nl {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.nl_family.hash(state);
+ self.nl_pid.hash(state);
+ self.nl_groups.hash(state);
+ }
+ }
+
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 9f3bb3507e..854068bfce 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -242,13 +242,6 @@ s_no_extra_traits!{
pub machine: [::c_char; 65],
pub domainname: [::c_char; 65]
}
-
- pub struct sockaddr_nl {
- pub nl_family: ::sa_family_t,
- nl_pad: ::c_ushort,
- pub nl_pid: u32,
- pub nl_groups: u32
- }
}
cfg_if! {
@@ -394,31 +387,6 @@ cfg_if! {
self.domainname.hash(state);
}
}
-
- impl PartialEq for sockaddr_nl {
- fn eq(&self, other: &sockaddr_nl) -> bool {
- self.nl_family == other.nl_family &&
- self.nl_pid == other.nl_pid &&
- self.nl_groups == other.nl_groups
- }
- }
- impl Eq for sockaddr_nl {}
- impl ::fmt::Debug for sockaddr_nl {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sockaddr_nl")
- .field("nl_family", &self.nl_family)
- .field("nl_pid", &self.nl_pid)
- .field("nl_groups", &self.nl_groups)
- .finish()
- }
- }
- impl ::hash::Hash for sockaddr_nl {
- fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- self.nl_family.hash(state);
- self.nl_pid.hash(state);
- self.nl_groups.hash(state);
- }
- }
}
}