Skip to content

Commit 6fa7ed3

Browse files
devnexenAkhilTThomas
authored andcommitted
freebsd moving the kinfo_file type to general use.
but keeping the constant KINFO_FILE_SIZE for intel archs only. [Resolved conflicts - Trevor] (backport <rust-lang#3801>) (cherry picked from commit 34942a5) Signed-off-by: Trevor Gross <[email protected]>
1 parent e13ebd8 commit 6fa7ed3

File tree

1 file changed

+46
-0
lines changed
  • src/unix/bsd/freebsdlike/freebsd

1 file changed

+46
-0
lines changed

src/unix/bsd/freebsdlike/freebsd/mod.rs

+46
Original file line numberDiff line numberDiff line change
@@ -2541,6 +2541,52 @@ cfg_if! {
25412541
.finish()
25422542
}
25432543
}
2544+
2545+
impl PartialEq for kinfo_file {
2546+
fn eq(&self, other: &kinfo_file) -> bool {
2547+
self.kf_structsize == other.kf_structsize &&
2548+
self.kf_type == other.kf_type &&
2549+
self.kf_fd == other.kf_fd &&
2550+
self.kf_ref_count == other.kf_ref_count &&
2551+
self.kf_flags == other.kf_flags &&
2552+
self.kf_offset == other.kf_offset &&
2553+
self.kf_status == other.kf_status &&
2554+
self.kf_cap_rights == other.kf_cap_rights &&
2555+
self.kf_path
2556+
.iter()
2557+
.zip(other.kf_path.iter())
2558+
.all(|(a,b)| a == b)
2559+
}
2560+
}
2561+
impl Eq for kinfo_file {}
2562+
impl ::fmt::Debug for kinfo_file {
2563+
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
2564+
f.debug_struct("kinfo_file")
2565+
.field("kf_structsize", &self.kf_structsize)
2566+
.field("kf_type", &self.kf_type)
2567+
.field("kf_fd", &self.kf_fd)
2568+
.field("kf_ref_count", &self.kf_ref_count)
2569+
.field("kf_flags", &self.kf_flags)
2570+
.field("kf_offset", &self.kf_offset)
2571+
.field("kf_status", &self.kf_status)
2572+
.field("kf_cap_rights", &self.kf_cap_rights)
2573+
.field("kf_path", &&self.kf_path[..])
2574+
.finish()
2575+
}
2576+
}
2577+
impl ::hash::Hash for kinfo_file {
2578+
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
2579+
self.kf_structsize.hash(state);
2580+
self.kf_type.hash(state);
2581+
self.kf_fd.hash(state);
2582+
self.kf_ref_count.hash(state);
2583+
self.kf_flags.hash(state);
2584+
self.kf_offset.hash(state);
2585+
self.kf_status.hash(state);
2586+
self.kf_cap_rights.hash(state);
2587+
self.kf_path.hash(state);
2588+
}
2589+
}
25442590
}
25452591
}
25462592

0 commit comments

Comments
 (0)