Skip to content

Commit

Permalink
Merge #1252
Browse files Browse the repository at this point in the history
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 <nick.pelone@calyptix.com>
  • Loading branch information
bors[bot] and nickpelone committed May 31, 2020
2 parents d950c48 + efef981 commit a3ecdb1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
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

0 comments on commit a3ecdb1

Please sign in to comment.