use super::prelude::*;
use serde::Serialize;
pub(crate) fn get_definitions(inp: &mut Definitions) {
inp.add(
Ident::Swapon,
vec!["path", "swapflags"],
vec![AV::CString(In), AV::Int(In)], AV::Int(Out),
);
inp.add(
Ident::Swapoff,
vec!["path"],
vec![AV::CString(In)],
AV::Int(Out),
);
}
#[derive(Debug, PartialEq, FromPtrace, Serialize)]
#[hstrace(hmz("Enable swap for path {:?} with flags {:?}", self.path, self.swapflags))]
pub struct Swapon {
#[hstrace]
pub path: String,
#[hstrace]
pub swapflags: isize, }
#[derive(Debug, PartialEq, FromPtrace, Serialize)]
#[hstrace(hmz("Disable swap path {}", self.path))]
pub struct Swapoff {
#[hstrace]
pub path: String,
}
bitflags! {
pub struct SwapFlag: isize {
const SWAP_FLAG_PREFER = 0x8000;
const SWAP_FLAG_PRIO_MASK = 0x7fff;
const SWAP_FLAG_PRIO_SHIFT = 0;
const SWAP_FLAG_DISCARD = 0x10000;
}
}