Skip to content

Correct the definition of sigval #4637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@ missing! {
}
pub type locale_t = *mut c_void;

s_no_extra_traits! {
pub union sigval {
pub sival_ptr: *mut c_void,
pub sival_int: c_int,
}
}

impl hash::Hash for sigval {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
state.write_usize(unsafe { self.sival_ptr } as usize);
}
}

impl ::core::cmp::PartialEq for sigval {
fn eq(&self, other: &Self) -> bool {
unsafe { self.sival_ptr == other.sival_ptr }
}
}

impl ::core::cmp::Eq for sigval {}

s! {
pub struct group {
pub gr_name: *mut c_char,
Expand Down
Loading