Skip to content

Commit

Permalink
DragonFlyBSD: refine kqueue-related types and values
Browse files Browse the repository at this point in the history
- Make sure that Filter and Flag types are defined. The sizes
  for these kevent fields are the same as on FreeBSD and OpenBSD

- Don't define the NOTE_BACKGROUND EVFILT_TIMER flag. This flag
  value is exclusive to Apple platforms.
  • Loading branch information
cmusser authored and Thomasdezeeuw committed Feb 17, 2021
1 parent 542fec1 commit b51af46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sys/unix/selector/kqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ type Count = libc::c_int;
type Count = libc::size_t;

// Type of the `filter` field in the `kevent` structure.
#[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
type Filter = libc::c_short;
#[cfg(any(target_os = "macos", target_os = "ios"))]
type Filter = i16;
#[cfg(target_os = "netbsd")]
type Filter = u32;

// Type of the `flags` field in the `kevent` structure.
#[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
type Flags = libc::c_ushort;
#[cfg(any(target_os = "macos", target_os = "ios"))]
type Flags = u16;
Expand Down Expand Up @@ -651,7 +651,7 @@ pub mod event {
libc::NOTE_LEEWAY,
#[cfg(any(target_os = "ios", target_os = "macos"))]
libc::NOTE_CRITICAL,
#[cfg(any(target_os = "dragonfly"))]
#[cfg(any(target_os = "ios", target_os = "macos"))]
libc::NOTE_BACKGROUND,
);

Expand Down

0 comments on commit b51af46

Please sign in to comment.