Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@ shmctl
shmdt
shmget
shmid_ds
sig_t
sigevent
siginfo_t
sigsuspend
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@ shmctl
shmdt
shmget
shmid_ds
sig_t
sigaltstack
sigevent
siginfo_t
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,7 @@ shmctl
shmdt
shmget
shmid_ds
sig_t
sigaltstack
sigevent
siginfo_t
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ shmctl
shmdt
shmget
shmid_ds
sig_t
sigaltstack
sigevent
siginfo_t
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ shmctl
shmdt
shmget
shmid_ds
sig_t
sigaltstack
siginfo_t
sigsuspend
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,11 @@ s! {
_pad: Padding<[usize; 9]>,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
// FIXME(union): this field is actually a union
pub sa_sigaction: crate::sighandler_t,
pub sa_sigaction: crate::sig_t,
pub sa_mask: sigset_t,
pub sa_flags: c_int,
}
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ s! {
_pad2: Padding<[c_int; 7]>,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_sigaction: crate::sig_t,
pub sa_flags: c_int,
pub sa_mask: sigset_t,
}
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub type nfds_t = c_uint;
pub type regoff_t = c_int;
#[cfg(not(target_os = "dragonfly"))]
pub type regoff_t = off_t;
pub type sig_t = Option<unsafe extern "C" fn(crate::c_int)>;

s! {
pub struct sockaddr {
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ s! {
pub sched_priority: c_int,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_sigaction: crate::sig_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
}
Expand Down
16 changes: 16 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,24 @@ extern "C" {
#[cfg_attr(gnu_file_offset_bits64, link_name = "ftruncate64")]
pub fn ftruncate(fd: c_int, length: off_t) -> c_int;

#[cfg(not(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "netbsd",
target_os = "openbsd"
)))]
pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t;

#[cfg(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "netbsd",
target_os = "openbsd"
))]
pub fn signal(signum: c_int, handler: sig_t) -> sig_t;

#[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
#[cfg_attr(gnu_time_bits64, link_name = "__getrusage64")]
#[cfg_attr(musl_redir_time64, link_name = "__getrusage_time64")]
Expand Down