diff --git a/Cargo.toml b/Cargo.toml index bcca102820..ee5c8e6623 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ targets = [ ] [dependencies] -libc = { version = "=0.2.175", features = ["extra_traits"] } +libc = { version = "=0.2.180", features = ["extra_traits"] } bitflags = "2.3.3" cfg-if = "1.0" pin-utils = { version = "0.1.0", optional = true } diff --git a/changelog/2724.changed.md b/changelog/2724.changed.md new file mode 100644 index 0000000000..2317cfa9c4 --- /dev/null +++ b/changelog/2724.changed.md @@ -0,0 +1 @@ +Bumped libc to [0.2.180](https://github.com/rust-lang/libc/releases/tag/0.2.180) diff --git a/changelog/2724.removed.md b/changelog/2724.removed.md new file mode 100644 index 0000000000..1e05aa62d4 --- /dev/null +++ b/changelog/2724.removed.md @@ -0,0 +1 @@ +Removed `IFF_NOTRAILERS` by NetBSD, as it has been removed upstream and from libc diff --git a/src/net/if_.rs b/src/net/if_.rs index cae6e3f826..1e2085c338 100644 --- a/src/net/if_.rs +++ b/src/net/if_.rs @@ -66,7 +66,6 @@ libc_bitflags!( solarish, apple_targets, target_os = "fuchsia", - target_os = "netbsd", target_os = "cygwin"))] IFF_NOTRAILERS as IflagsType; /// Interface manages own routes. diff --git a/src/sys/event.rs b/src/sys/event.rs index ce3d558312..b93004904f 100644 --- a/src/sys/event.rs +++ b/src/sys/event.rs @@ -91,11 +91,6 @@ impl Kqueue { } } -#[cfg(any(freebsdlike, apple_targets, target_os = "openbsd"))] -type type_of_udata = *mut libc::c_void; -#[cfg(target_os = "netbsd")] -type type_of_udata = intptr_t; - #[cfg(target_os = "netbsd")] type type_of_event_filter = u32; #[cfg(not(target_os = "netbsd"))] @@ -364,7 +359,7 @@ impl KEvent { fflags: fflags.bits(), // data can be either i64 or intptr_t, depending on platform data: data as _, - udata: udata as type_of_udata, + udata: udata as *mut libc::c_void, ..unsafe { mem::zeroed() } }, } @@ -456,5 +451,5 @@ pub fn ev_set( ev.kevent.flags = flags.bits(); ev.kevent.fflags = fflags.bits(); ev.kevent.data = 0; - ev.kevent.udata = udata as type_of_udata; + ev.kevent.udata = udata as *mut libc::c_void; } diff --git a/src/sys/termios.rs b/src/sys/termios.rs index b7a693ab10..b5d8fed5f7 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -478,6 +478,14 @@ libc_bitflags! { ICRNL; IXON; IXOFF; + #[cfg(any(linux_android, + target_os = "aix", + target_os = "cygwin", + target_os = "haiku", + target_os = "hurd", + target_os = "nto", + solarish))] + IUCLC; #[cfg(not(target_os = "redox"))] IXANY; #[cfg(not(any(target_os = "redox", target_os = "haiku")))] diff --git a/src/sys/time.rs b/src/sys/time.rs index 7e89c72149..814ecc9394 100644 --- a/src/sys/time.rs +++ b/src/sys/time.rs @@ -624,6 +624,10 @@ impl TimeVal { }) } + #[cfg_attr( + any(target_env = "musl", target_env = "ohos"), + allow(deprecated) + )] // https://github.com/rust-lang/libc/issues/1848 fn micros_mod_sec(&self) -> suseconds_t { if self.tv_sec() < 0 && self.tv_usec() > 0 { self.tv_usec() - MICROS_PER_SEC as suseconds_t @@ -640,6 +644,10 @@ impl TimeVal { self.0.tv_sec } + #[cfg_attr( + any(target_env = "musl", target_env = "ohos"), + allow(deprecated) + )] // https://github.com/rust-lang/libc/issues/1848 pub const fn tv_usec(&self) -> suseconds_t { self.0.tv_usec }