pub struct UNotifyEventRequest { /* private fields */ }
Expand description

UNotifyEventRequest is the type of parameter that user’s function would get.

Implementations§

source§

impl UNotifyEventRequest

source

pub fn get_request(&self) -> &ScmpNotifReq

Returns the unotify request (libseccomp::ScmpNotifReq) of this event.

source

pub unsafe fn continue_syscall(&self) -> ScmpNotifResp

Let the kernel continue the syscall.

Safety

CAUTION! This method is unsafe because it may suffer TOCTOU attack. Please read seccomp_unotify(2) “NOTES/Design goals; use of SECCOMP_USER_NOTIF_FLAG_CONTINUE” before using this method.

source

pub fn fail_syscall(&self, err: i32) -> ScmpNotifResp

Returns error to supervised process. err parameter should be a number larger than 0.

source

pub fn return_syscall(&self, val: i64) -> ScmpNotifResp

Returns value to supervised process.

source

pub fn is_valid(&self) -> bool

Check if this event is still valid. In some cases this is necessary, please check seccomp_unotify(2) for more information.

source

pub fn add_fd(&self, src_fd: RawFd) -> Result<RawFd, Error>

Add a file descriptor to the supervised process. This could help avoid TOCTOU attack in some cases.

Trait Implementations§

source§

impl Debug for UNotifyEventRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.