Skip to content

Commit 1f657fc

Browse files
committed
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
1 parent 89d8c5e commit 1f657fc

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,19 +3088,6 @@ pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4;
30883088
pub const CAN_RAW_FD_FRAMES: ::c_int = 5;
30893089
pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6;
30903090

3091-
#[deprecated(
3092-
since = "0.2.102",
3093-
note = "Errnoeously uses c_int; should use c_short."
3094-
)]
3095-
#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
3096-
pub const POLLRDHUP: ::c_int = 0x2000;
3097-
#[deprecated(
3098-
since = "0.2.102",
3099-
note = "Errnoeously uses c_int; should use c_short."
3100-
)]
3101-
#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
3102-
pub const POLLRDHUP: ::c_int = 0x800;
3103-
31043091
f! {
31053092
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
31063093
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)

src/unix/linux_like/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,10 @@ pub const POLLHUP: ::c_short = 0x10;
12371237
pub const POLLNVAL: ::c_short = 0x20;
12381238
pub const POLLRDNORM: ::c_short = 0x040;
12391239
pub const POLLRDBAND: ::c_short = 0x080;
1240+
#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
1241+
pub const POLLRDHUP: ::c_short = 0x2000;
1242+
#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
1243+
pub const POLLRDHUP: ::c_short = 0x800;
12401244

12411245
pub const IPTOS_LOWDELAY: u8 = 0x10;
12421246
pub const IPTOS_THROUGHPUT: u8 = 0x08;

0 commit comments

Comments
 (0)