diff options
author | Dan Gohman <dev@sunfishcode.online> | 2021-09-05 16:00:49 -0700 |
---|---|---|
committer | Dan Gohman <dev@sunfishcode.online> | 2021-10-27 03:58:29 -0700 |
commit | 1f657fc1bc136a8187fd1986f6508e510d3d4f26 (patch) | |
tree | 2bc9044428ef80cc738ed7e23c9701195f288edb | |
parent | 89d8c5e7d08872dd21d55327731f0d72d2a34e58 (diff) | |
download | rust-libc-1f657fc1bc136a8187fd1986f6508e510d3d4f26.tar.gz |
Move Linux's `POLLRDHUP` into `linux_like` and fix its type.
This was originally posted as #2390, but since it was a breaking change,
that PR instead just added `deprecated` warnings. There haven't been any
concerns for a while, so this is now a PR to do the change actually, per
the [breaking-change-policy].
This fixes two errors in #2247.
- It moves the definitions of `POLLRDHUP` out of `linux_like/linux`
and into `linux_like`, so that they're available on Android as well.
- It changes the type from `c_int` to `c_short` to match the other
`POLL*` flags.
[breaking-change-policy]: https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md#breaking-change-policy
-rw-r--r-- | src/unix/linux_like/linux/mod.rs | 13 | ||||
-rw-r--r-- | src/unix/linux_like/mod.rs | 4 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index d0d86ac0b5..6353ecf8b6 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -3088,19 +3088,6 @@ pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4; pub const CAN_RAW_FD_FRAMES: ::c_int = 5; pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6; -#[deprecated( - since = "0.2.102", - note = "Errnoeously uses c_int; should use c_short." -)] -#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))] -pub const POLLRDHUP: ::c_int = 0x2000; -#[deprecated( - since = "0.2.102", - note = "Errnoeously uses c_int; should use c_short." -)] -#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] -pub const POLLRDHUP: ::c_int = 0x800; - f! { pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 6df7ca0aef..96f179c4f2 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1237,6 +1237,10 @@ pub const POLLHUP: ::c_short = 0x10; pub const POLLNVAL: ::c_short = 0x20; pub const POLLRDNORM: ::c_short = 0x040; pub const POLLRDBAND: ::c_short = 0x080; +#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))] +pub const POLLRDHUP: ::c_short = 0x2000; +#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] +pub const POLLRDHUP: ::c_short = 0x800; pub const IPTOS_LOWDELAY: u8 = 0x10; pub const IPTOS_THROUGHPUT: u8 = 0x08; |