a10 0.4.1

This library is meant as a low-level library safely exposing different OS's abilities to perform non-blocking I/O.
Documentation
use std::io;

use crate::kqueue::op::DirectOp;
use crate::mem::AdviseFlag;
use crate::{SubmissionQueue, syscall};

pub(crate) struct AdviseOp;

impl DirectOp for AdviseOp {
    type Output = ();
    type Resources = ();
    type Args = (*mut (), u32, AdviseFlag); // address, length, advice.

    fn run(
        _: &SubmissionQueue,
        (): Self::Resources,
        (address, length, advice): Self::Args,
    ) -> io::Result<Self::Output> {
        syscall!(madvise(address.cast(), length as _, advice.0.cast_signed()))?;
        Ok(())
    }
}