diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8aeb2abe..28e2b5ba1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/sys/event.rs b/src/sys/event.rs index 7af5ae2b15..cf9393bd3a 100644 --- a/src/sys/event.rs +++ b/src/sys/event.rs @@ -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; @@ -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; @@ -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; } diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 52768c9351..a3c0d1284e 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -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)] @@ -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>( diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 9bf458285f..d6c1ec0cbb 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -309,7 +309,6 @@ mod recvfrom { target_os = "linux", target_os = "android", target_os = "freebsd", - target_os = "openbsd", target_os = "netbsd", ))] #[test]