pub struct OS;Expand description
Linux implementation of the OS trait.
Trait Implementations§
Source§impl OSMemory for Linux
impl OSMemory for Linux
Source§fn dzmmap(
start: Address,
size: usize,
strategy: MmapStrategy,
annotation: &MmapAnnotation<'_>,
) -> MmapResult<Address>
fn dzmmap( start: Address, size: usize, strategy: MmapStrategy, annotation: &MmapAnnotation<'_>, ) -> MmapResult<Address>
Perform a demand-zero mmap. Read more
Source§fn set_memory_access(
start: Address,
size: usize,
prot: MmapProtection,
) -> Result<()>
fn set_memory_access( start: Address, size: usize, prot: MmapProtection, ) -> Result<()>
Change the protection of a memory region to the specified protection.
Source§fn is_mmap_oom(os_errno: i32) -> bool
fn is_mmap_oom(os_errno: i32) -> bool
Check whether the given OS error number indicates an out-of-memory condition.
Source§fn panic_if_unmapped(start: Address, size: usize)
fn panic_if_unmapped(start: Address, size: usize)
Checks if the memory has already been mapped. If not, we panic. Read more
Source§fn handle_mmap_error<VM: VMBinding>(mmap_error: MmapError, tls: VMThread)
fn handle_mmap_error<VM: VMBinding>(mmap_error: MmapError, tls: VMThread)
Handle mmap errors, possibly by signaling the VM about an out-of-memory condition.
Source§fn get_system_total_memory() -> Result<u64>
fn get_system_total_memory() -> Result<u64>
Get the total memory of the system in bytes.
Source§impl OSProcess for Linux
impl OSProcess for Linux
Source§type ProcessIDType = i32
type ProcessIDType = i32
The process ID type for the OS.
Source§type ThreadIDType = u64
type ThreadIDType = u64
The thread ID type for the OS.
Source§fn get_process_memory_maps() -> Result<String>
fn get_process_memory_maps() -> Result<String>
Get the memory maps for the process. The returned string is a multi-line string.
Fallback: This is only used for debugging. For unimplemented cases, this function can return a placeholder Ok value.
Source§fn get_process_id() -> Result<Self::ProcessIDType>
fn get_process_id() -> Result<Self::ProcessIDType>
Get the process ID as a string.
Fallback: This is only used for debugging. For unimplemented cases, this function can return a placeholder Ok value.
Source§fn get_thread_id() -> Result<Self::ThreadIDType>
fn get_thread_id() -> Result<Self::ThreadIDType>
Fallback: This is only used for debugging. For unimplemented cases, this function can return a placeholder Ok value.
Source§fn get_total_num_cpus() -> CoreNum
fn get_total_num_cpus() -> CoreNum
Return the total number of cores allocated to the program.
Source§fn bind_current_thread_to_core(core_id: CoreId)
fn bind_current_thread_to_core(core_id: CoreId)
Bind the current thread to the specified core.
Source§fn bind_current_thread_to_cpuset(core_ids: &[CoreId])
fn bind_current_thread_to_cpuset(core_ids: &[CoreId])
Bind the current thread to the specified core set.
Auto Trait Implementations§
impl Freeze for Linux
impl RefUnwindSafe for Linux
impl Send for Linux
impl Sync for Linux
impl Unpin for Linux
impl UnwindSafe for Linux
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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