use libc::pid_t;
use crate::{policy::Syscall, registers::Registers, SeccompError};
pub struct Interceptor {
pub syscall: Syscall,
pub registers: Registers,
pub child_pid: pid_t,
}
impl Interceptor {
pub fn new(sc: Syscall, regs: Registers, child_pid: pid_t) -> Self {
Self {
syscall: sc,
registers: regs,
child_pid: child_pid,
}
}
pub fn commit_regs(&self) -> Result<(), SeccompError> {
self.registers.commit_regs(self.child_pid)?;
Ok(())
}
}