Skip to content

Commit

Permalink
Allow using time_t despite deprecation on musl
Browse files Browse the repository at this point in the history
  • Loading branch information
sirhcel committed Aug 2, 2024
1 parent a192b66 commit 1517bca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/posix/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ fn poll_clamped(fd: &mut PollFd, timeout: Duration) -> nix::Result<c_int> {
}

#[cfg(any(target_os = "linux", test))]
// The type time_t is deprecaten on musl. The nix crate internally uses this type and makes an
// exeption for the deprecation for musl. And so do we.
//
// See https://github.com/rust-lang/libc/issues/1848 which is referenced from every exemption used
// in nix.
#[cfg_attr(target_env = "musl", allow(deprecated))]
fn clamped_time_spec(duration: Duration) -> TimeSpec {
use nix::libc::c_long;
use nix::sys::time::time_t;
Expand Down

0 comments on commit 1517bca

Please sign in to comment.