restrict 0.2.1

A crate to allow, deny, or trace Linux syscalls with an ergonomic, auto-generated enum customized for your system architecture.
Documentation
use std::fs;

use restrict::{syscall::Syscall, *};

use policy::Policy;
fn main() -> Result<(), SeccompError> {
    println!("This will process will be killed!");

    let mut filter = Policy::allow_all()?;
    filter.deny(Syscall::Openat);

    println!("This should work");
    filter.apply()?;

    // openat() syscall
    let _read_fs = fs::read("test.txt").unwrap();
    println!(
        "The current proccess should be killed before this is displayed because this uses openat() syscall"
    );
    Ok(())
}