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

Use EV_ONESHOT #38

Merged
merged 2 commits into from
Aug 28, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ task:
VERSION: nightly
- name: FreeBSD 13 amd64 MSRV
env:
VERSION: 1.56.1
VERSION: 1.65.0
# Install Rust
setup_script:
- fetch https://sh.rustup.rs -o rustup.sh
- sh rustup.sh -y --default-toolchain $VERSION
- $HOME/.cargo/bin/rustc --version | grep -q "1.56.1" && cp Cargo.lock.msrv Cargo.lock
# aio on ufs is considered unsafe
- sysctl vfs.aio.enable_unsafe=1
cargo_cache:
Expand Down
315 changes: 0 additions & 315 deletions Cargo.lock.msrv

This file was deleted.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ tokio = []

[dependencies]
mio = "0.8.0"
nix = { version ="0.26.1", default-features = false, features = ["aio"] }
nix = {version = "0.27.0", default-features = false, features = ["aio", "event"] }
pin-utils = "0.1.0"

[dev-dependencies]
assert-impl = "0.1"
mio = { version = "0.8.0", features = ["os-poll"] }
nix = { version = "0.26.1", default-features = false, features = ["aio", "feature"] }
nix = {version = "0.27.0", default-features = false, features = ["aio", "event", "feature"] }
sysctl = "0.1"
tempfile = "3.4"

Expand Down
9 changes: 7 additions & 2 deletions src/aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use nix::{
libc::off_t,
sys::{
aio::{self, Aio},
event::EventFlag,
signal::SigevNotify
}
};
Expand Down Expand Up @@ -73,7 +74,7 @@ pub trait SourceApi {
/// A Mio source based on a single POSIX AIO operation.
///
/// The generic parameter specifies exactly which operation it is. This struct
/// implements `mio::Source`. After cration, hse `mio::Source::register` to
/// implements `mio::Source`. After cration, use `mio::Source::register` to
/// connect it to the event loop.
#[derive(Debug)]
pub struct Source<T>{inner: T}
Expand All @@ -86,7 +87,11 @@ impl<T: Aio> Source<T> {
}

fn _register_raw(&mut self, kq: RawFd, udata: usize) {
let sigev = SigevNotify::SigevKevent{kq, udata: udata as isize};
let sigev = SigevNotify::SigevKeventFlags{
kq,
udata: udata as isize,
flags: EventFlag::EV_ONESHOT
};
self.inner.set_sigev_notify(sigev);
}
}
Expand Down