Skip to main content

_dr_syscall_result_info_t

Struct _dr_syscall_result_info_t 

Source
#[repr(C)]
pub struct _dr_syscall_result_info_t { pub size: usize, pub succeeded: bool_, pub value: reg_t, pub high: reg_t, pub use_high: bool_, pub use_errno: bool_, pub errno_value: uint, }
Expand description

Data structure used to obtain or modify the result of an application system call by dr_syscall_get_result_ex() and dr_syscall_set_result_ex().

Fields§

§size: usize

The caller should set this to the size of the structure.

§succeeded: bool_

Indicates whether the system call succeeded or failed. For dr_syscall_set_result_ex(), this requests that DR set any additional machine state, if any, used by the particular plaform that is not part of \p value to indicate success or failure (e.g., on MacOS the carry flag is used to indicate success).

For Windows, the success result from dr_syscall_get_result_ex() should only be relied upon for ntoskrnl system calls. For other Windows system calls (such as win32k.sys graphical (NtGdi) or user (NtUser) system calls), computing success depends on each particular call semantics and is beyond the scope of this routine (consider using the “drsyscall” Extension instead).

For Mach syscalls on MacOS, the success result from dr_syscall_get_result_ex() should not be relied upon. Computing success depends on each particular call semantics and is beyond the scope of this routine (consider using the “drsyscall” Extension instead).

§value: reg_t

The raw main value returned by the system call. See also the \p high field.

§high: reg_t

On some platforms (such as MacOS), a 32-bit application’s system call can return a 64-bit value. For such calls, this field will hold the top 32 bit bits, if requested by \p use_high. It is up to the caller to know which system calls have 64-bit return values. System calls that return only 32-bit values do not clear the upper bits. Consider using the “drsyscall” Extension in order to obtain per-system-call semantic information, including return type.

§use_high: bool_

This should be set by the caller, and only applies to 32-bit system calls. For dr_syscall_get_result_ex(), this requests that DR fill in the \p high field. For dr_syscall_set_result_ex(), this requests that DR set the high 32 bits of the application-facing result to the value in the \p high field.

§use_errno: bool_

This should be set by the caller. For dr_syscall_get_result_ex(), this requests that DR fill in the \p errno_value field. For dr_syscall_set_result_ex(), this requests that DR set the \p value to indicate the particular error code in \p errno_value.

§errno_value: uint

If requested by \p use_errno, if a system call fails (i.e., \p succeeded is false) dr_syscall_get_result_ex() will set this field to the absolute value of the error code returned (i.e., on Linux, it will be inverted from what the kernel directly returns, in order to facilitate cross-platform clients that operate on both Linux and MacOS). For Linux and Macos, when \p succeeded is true, \p errno_value is set to 0.

If \p use_errno is set for dr_syscall_set_result_ex(), then this value will be stored as the system call’s return value, negated if necessary for the underlying platform. In that case, \p value will be ignored.

Trait Implementations§

Source§

impl Clone for _dr_syscall_result_info_t

Source§

fn clone(&self) -> _dr_syscall_result_info_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _dr_syscall_result_info_t

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Copy for _dr_syscall_result_info_t

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V