Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EV_DISPATCH, EV_RECEIPT items for EventFlags, and fix build on OpenBSD #1252

Merged
merged 4 commits into from May 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
(#[1216](https://github.com/nix-rust/nix/pull/1216))
- Added `BindToDevice` socket option (sockopt) on Linux
(#[1233](https://github.com/nix-rust/nix/pull/1233))
- Added `EventFilter` bitflags for `EV_DISPATCH` and `EV_RECEIPT` on OpenBSD.
(#[1252](https://github.com/nix-rust/nix/pull/1252))

### Changed
- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201))
Expand Down
11 changes: 3 additions & 8 deletions src/sys/event.rs
Expand Up @@ -28,7 +28,7 @@ type type_of_data = intptr_t;
#[cfg(any(target_os = "netbsd"))]
type type_of_udata = intptr_t;
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
type type_of_data = libc::int64_t;
type type_of_data = i64;

#[cfg(target_os = "netbsd")]
type type_of_event_filter = u32;
Expand Down Expand Up @@ -90,14 +90,9 @@ libc_bitflags!{
EV_CLEAR;
EV_DELETE;
EV_DISABLE;
// No released version of OpenBSD supports EV_DISPATCH or EV_RECEIPT.
// These have been commited to the -current branch though and are
// expected to be part of the OpenBSD 6.2 release in Nov 2017.
// See: https://marc.info/?l=openbsd-tech&m=149621427511219&w=2
// https://github.com/rust-lang/libc/pull/613
#[cfg(any(target_os = "dragonfly", target_os = "freebsd",
target_os = "ios", target_os = "macos",
target_os = "netbsd"))]
target_os = "netbsd", target_os = "openbsd"))]
EV_DISPATCH;
#[cfg(target_os = "freebsd")]
EV_DROP;
Expand All @@ -116,7 +111,7 @@ libc_bitflags!{
EV_POLL;
#[cfg(any(target_os = "dragonfly", target_os = "freebsd",
target_os = "ios", target_os = "macos",
target_os = "netbsd"))]
target_os = "netbsd", target_os = "openbsd"))]
EV_RECEIPT;
EV_SYSFLAGS;
}
Expand Down
2 changes: 0 additions & 2 deletions src/sys/socket/mod.rs
Expand Up @@ -920,7 +920,6 @@ pub fn sendmsg(fd: RawFd, iov: &[IoVec<&[u8]>], cmsgs: &[ControlMessage],
target_os = "linux",
target_os = "android",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
))]
#[derive(Debug)]
Expand Down Expand Up @@ -956,7 +955,6 @@ pub struct SendMmsgData<'a, I, C>
target_os = "linux",
target_os = "android",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
))]
pub fn sendmmsg<'a, I, C>(
Expand Down
1 change: 0 additions & 1 deletion test/sys/test_socket.rs
Expand Up @@ -309,7 +309,6 @@ mod recvfrom {
target_os = "linux",
target_os = "android",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
))]
#[test]
Expand Down