Skip to content

Commit

Permalink
Move Linux's POLLRDHUP into linux_like and fix its type.
Browse files Browse the repository at this point in the history
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.

This second change is a breaking change, and I'm fine reverting it and
leaving it as the old type if that's the right thing to do.
  • Loading branch information
sunfishcode committed Sep 5, 2021
1 parent 5fefaf6 commit 84aae8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -3037,11 +3037,6 @@ pub const SOL_CAN_BASE: ::c_int = 100;
pub const CAN_INV_FILTER: canid_t = 0x20000000;
pub const CAN_RAW_FILTER_MAX: ::c_int = 512;

#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
pub const POLLRDHUP: ::c_int = 0x2000;
#[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)
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/mod.rs
Expand Up @@ -1221,6 +1221,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;
Expand Down

0 comments on commit 84aae8c

Please sign in to comment.