Trait miri::shims::unix::fd::EvalContextExt

source ·
pub trait EvalContextExt<'tcx>: MiriInterpCxExt<'tcx> {
    // Provided methods
    fn dup(&mut self, old_fd: i32) -> InterpResult<'tcx, i32> { ... }
    fn dup2(&mut self, old_fd: i32, new_fd: i32) -> InterpResult<'tcx, i32> { ... }
    fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, i32> { ... }
    fn close(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> { ... }
    fn fd_not_found<T: From<i32>>(&mut self) -> InterpResult<'tcx, T> { ... }
    fn read(
        &mut self,
        fd: i32,
        buf: Pointer,
        count: u64,
    ) -> InterpResult<'tcx, i64> { ... }
    fn write(
        &mut self,
        fd: i32,
        buf: Pointer,
        count: u64,
    ) -> InterpResult<'tcx, i64> { ... }
}

Provided Methods§

source

fn dup(&mut self, old_fd: i32) -> InterpResult<'tcx, i32>

source

fn dup2(&mut self, old_fd: i32, new_fd: i32) -> InterpResult<'tcx, i32>

source

fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, i32>

source

fn close(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source

fn fd_not_found<T: From<i32>>(&mut self) -> InterpResult<'tcx, T>

Function used when a file descriptor does not exist. It returns Ok(-1)and sets the last OS error to libc::EBADF (invalid file descriptor). This function uses T: From<i32> instead of i32 directly because some fs functions return different integer types (like read, that returns an i64).

source

fn read(&mut self, fd: i32, buf: Pointer, count: u64) -> InterpResult<'tcx, i64>

source

fn write( &mut self, fd: i32, buf: Pointer, count: u64, ) -> InterpResult<'tcx, i64>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>