pub(crate) struct Req<'a> {
pub ctx: &'a Ctx,
pub listener: i32,
pub id: u64,
pub pid: u32,
pub args: [u64; 6],
pub raw_nr: i32,
pub abi: Abi,
pub variant: Variant,
view: OnceCell<Arc<View>>,
}Expand description
One notification plus the shared state needed to serve it.
Fields§
§ctx: &'a Ctx§listener: i32§id: u64§pid: u32§args: [u64; 6]§raw_nr: i32Syscall number as the tracee issued it, in its own ABI.
abi: AbiABI the request came through; 32-bit pointers are already zero-extended.
variant: VariantHow an i386 request differs from the x86_64 number it was mapped to.
view: OnceCell<Arc<View>>The caller’s view, looked up once per request.
Implementations§
Source§impl<'a> Req<'a>
impl<'a> Req<'a>
pub fn arg(&self, i: usize) -> u64
fn arg_i64(&self, i: usize) -> i64
fn dirfd(&self, i: usize) -> i32
Sourcepub fn path(&self, i: usize) -> Result<Vec<u8>, i32>
pub fn path(&self, i: usize) -> Result<Vec<u8>, i32>
Reads the NUL-terminated path in argument i, rewriting /proc/self
and /proc/thread-self to the tracee’s own entries since the
supervisor would otherwise see its own.
Sourcepub fn translate(
&self,
dirfd: i32,
path: &[u8],
deref_final: bool,
) -> Result<Resolved, i32>
pub fn translate( &self, dirfd: i32, path: &[u8], deref_final: bool, ) -> Result<Resolved, i32>
Translates path relative to dirfd into the object to act on.
Sourcepub fn translate_or_dirfd(
&self,
dirfd: i32,
path: &[u8],
deref_final: bool,
) -> Result<Resolved, i32>
pub fn translate_or_dirfd( &self, dirfd: i32, path: &[u8], deref_final: bool, ) -> Result<Resolved, i32>
Translates like Req::translate, except that an empty path names dirfd itself.
AT_EMPTY_PATH asks for that, and readlinkat always takes it; for
AT_FDCWD it is the tracee’s working directory.
§Arguments
dirfd- Base descriptor for a relative path, orlibc::AT_FDCWD.path- Path bytes as read from the tracee, without NUL.deref_final- Follow a symlink in the final component.
§Errors
As Req::translate, or the errno of reading the descriptor’s path.
Sourcepub fn valid(&self) -> Result<(), i32>
pub fn valid(&self) -> Result<(), i32>
Re-validates the notification; Err(DROPPED) when the tracee is gone.
Sourcepub fn check_writable(&self, resolved: &Resolved) -> Result<(), i32>
pub fn check_writable(&self, resolved: &Resolved) -> Result<(), i32>
Refuses with EROFS when the resolved path lies under a read-only binding.