Skip to content

Commit 84e66d7

Browse files
Merge #1252
1252: Add EV_DISPATCH, EV_RECEIPT items for EventFlags, and fix build on OpenBSD r=asomers a=nickpelone This pull request: - Adds `EV_DISPATCH` and `EV_RECEIPT` to `EventFlags`. OpenBSD supports these now. c379d1a - Fixes a regression that caused `nix` to be unable to build on OpenBSD since #1208. dd0a990 - Makes a change to avoid a deprecation warning from `libc` crate, which breaks tests. 0f9fcbd Since I know y'all don't have OpenBSD in CI right now, I've attached the results of a `cargo test` run on OpenBSD 6.7. Thanks for your time! [testresults.txt](https://github.com/nix-rust/nix/files/4684597/testresults.txt) Fixes #1251 Co-authored-by: Nick Pelone <[email protected]>
2 parents d950c48 + efef981 commit 84e66d7

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2929
(#[1216](https://github.com/nix-rust/nix/pull/1216))
3030
- Added `BindToDevice` socket option (sockopt) on Linux
3131
(#[1233](https://github.com/nix-rust/nix/pull/1233))
32+
- Added `EventFilter` bitflags for `EV_DISPATCH` and `EV_RECEIPT` on OpenBSD.
33+
(#[1252](https://github.com/nix-rust/nix/pull/1252))
3234

3335
### Changed
3436
- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201))

src/sys/event.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type type_of_data = intptr_t;
2828
#[cfg(any(target_os = "netbsd"))]
2929
type type_of_udata = intptr_t;
3030
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
31-
type type_of_data = libc::int64_t;
31+
type type_of_data = i64;
3232

3333
#[cfg(target_os = "netbsd")]
3434
type type_of_event_filter = u32;
@@ -90,14 +90,9 @@ libc_bitflags!{
9090
EV_CLEAR;
9191
EV_DELETE;
9292
EV_DISABLE;
93-
// No released version of OpenBSD supports EV_DISPATCH or EV_RECEIPT.
94-
// These have been commited to the -current branch though and are
95-
// expected to be part of the OpenBSD 6.2 release in Nov 2017.
96-
// See: https://marc.info/?l=openbsd-tech&m=149621427511219&w=2
97-
// https://github.com/rust-lang/libc/pull/613
9893
#[cfg(any(target_os = "dragonfly", target_os = "freebsd",
9994
target_os = "ios", target_os = "macos",
100-
target_os = "netbsd"))]
95+
target_os = "netbsd", target_os = "openbsd"))]
10196
EV_DISPATCH;
10297
#[cfg(target_os = "freebsd")]
10398
EV_DROP;
@@ -116,7 +111,7 @@ libc_bitflags!{
116111
EV_POLL;
117112
#[cfg(any(target_os = "dragonfly", target_os = "freebsd",
118113
target_os = "ios", target_os = "macos",
119-
target_os = "netbsd"))]
114+
target_os = "netbsd", target_os = "openbsd"))]
120115
EV_RECEIPT;
121116
EV_SYSFLAGS;
122117
}

src/sys/socket/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,6 @@ pub fn sendmsg(fd: RawFd, iov: &[IoVec<&[u8]>], cmsgs: &[ControlMessage],
920920
target_os = "linux",
921921
target_os = "android",
922922
target_os = "freebsd",
923-
target_os = "openbsd",
924923
target_os = "netbsd",
925924
))]
926925
#[derive(Debug)]
@@ -956,7 +955,6 @@ pub struct SendMmsgData<'a, I, C>
956955
target_os = "linux",
957956
target_os = "android",
958957
target_os = "freebsd",
959-
target_os = "openbsd",
960958
target_os = "netbsd",
961959
))]
962960
pub fn sendmmsg<'a, I, C>(

test/sys/test_socket.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ mod recvfrom {
309309
target_os = "linux",
310310
target_os = "android",
311311
target_os = "freebsd",
312-
target_os = "openbsd",
313312
target_os = "netbsd",
314313
))]
315314
#[test]

0 commit comments

Comments
 (0)