Struct linux_object::process::LinuxProcess
source · [−]pub struct LinuxProcess { /* private fields */ }
Expand description
Linux specific process information.
Implementations
sourceimpl LinuxProcess
impl LinuxProcess
sourcepub fn lookup_inode_at(
&self,
dirfd: FileDesc,
path: &str,
follow: bool
) -> LxResult<Arc<dyn INode>>
pub fn lookup_inode_at(
&self,
dirfd: FileDesc,
path: &str,
follow: bool
) -> LxResult<Arc<dyn INode>>
Lookup INode from the process.
-
If
path
is relative, then it is interpreted relative to the directory referred to by the file descriptordirfd
. -
If the
dirfd
is the special valueAT_FDCWD
, then the directory is current working directory of the process. -
If
path
is absolute, thendirfd
is ignored. -
If
follow
is true, then dereferencepath
if it is a symbolic link.
sourceimpl LinuxProcess
impl LinuxProcess
sourcepub fn new(rootfs: Arc<dyn FileSystem>) -> Self
pub fn new(rootfs: Arc<dyn FileSystem>) -> Self
Create a new process.
sourcepub fn get_free_fd(&self) -> FileDesc
pub fn get_free_fd(&self) -> FileDesc
Get lowest free fd
sourcepub fn get_free_fd_from(&self, start: usize) -> FileDesc
pub fn get_free_fd_from(&self, start: usize) -> FileDesc
get the lowest available fd great than or equal to start
.
sourcepub fn add_file(&self, file: Arc<dyn FileLike>) -> LxResult<FileDesc>
pub fn add_file(&self, file: Arc<dyn FileLike>) -> LxResult<FileDesc>
Add a file to the file descriptor table.
sourcepub fn add_socket(&self, file: Arc<dyn FileLike>) -> LxResult<FileDesc>
pub fn add_socket(&self, file: Arc<dyn FileLike>) -> LxResult<FileDesc>
Add a socket to the fd table.
sourcepub fn add_file_at(
&self,
fd: FileDesc,
file: Arc<dyn FileLike>
) -> LxResult<FileDesc>
pub fn add_file_at(
&self,
fd: FileDesc,
file: Arc<dyn FileLike>
) -> LxResult<FileDesc>
Add a file to the file descriptor table at given fd
.
sourcepub fn file_limit(&self, new_limit: Option<RLimit>) -> RLimit
pub fn file_limit(&self, new_limit: Option<RLimit>) -> RLimit
get and set file limit number
sourcepub fn get_file_like(&self, fd: FileDesc) -> LxResult<Arc<dyn FileLike>>
pub fn get_file_like(&self, fd: FileDesc) -> LxResult<Arc<dyn FileLike>>
Get the FileLike
with given fd
.
sourcepub fn close_file(&self, fd: FileDesc) -> LxResult
pub fn close_file(&self, fd: FileDesc) -> LxResult
Close file descriptor fd
.
sourcepub fn root_inode(&self) -> &Arc<dyn INode>
pub fn root_inode(&self) -> &Arc<dyn INode>
Get root INode of the process.
sourcepub fn current_working_directory(&self) -> String
pub fn current_working_directory(&self) -> String
Get current working directory.
sourcepub fn change_directory(&self, path: &str)
pub fn change_directory(&self, path: &str)
Change working directory.
sourcepub fn execute_path(&self) -> String
pub fn execute_path(&self) -> String
Get execute path.
sourcepub fn set_execute_path(&self, path: &str)
pub fn set_execute_path(&self, path: &str)
Set execute path.
sourcepub fn signal_action(&self, signal: LinuxSignal) -> SignalAction
pub fn signal_action(&self, signal: LinuxSignal) -> SignalAction
Get signal action.
sourcepub fn set_signal_action(&self, signal: LinuxSignal, action: SignalAction)
pub fn set_signal_action(&self, signal: LinuxSignal, action: SignalAction)
Set signal action.
sourcepub fn remove_cloexec_files(&self)
pub fn remove_cloexec_files(&self)
Close file that FD_CLOEXEC is set
sourcepub fn semaphores_add(&self, array: Arc<SemArray>) -> usize
pub fn semaphores_add(&self, array: Arc<SemArray>) -> usize
Insert a SemArray
and return its ID
sourcepub fn semaphores_add_undo(&self, id: usize, num: u16, op: i16)
pub fn semaphores_add_undo(&self, id: usize, num: u16, op: i16)
Add an undo operation
sourcepub fn semaphores_remove(&self, id: usize)
pub fn semaphores_remove(&self, id: usize)
Remove an SemArray
by ID
sourcepub fn shm_get_id(&self, id: usize) -> Option<usize>
pub fn shm_get_id(&self, id: usize) -> Option<usize>
get ShmId from Virtual Addr
sourcepub fn shm_get(&self, id: usize) -> Option<ShmIdentifier>
pub fn shm_get(&self, id: usize) -> Option<ShmIdentifier>
get the ShmIdentifier from shm_identifiers
sourcepub fn shm_add(&self, shared_guard: Arc<Mutex<ShmGuard>>) -> usize
pub fn shm_add(&self, shared_guard: Arc<Mutex<ShmGuard>>) -> usize
Insert the SharedGuard
and return its ID
sourcepub fn shm_set(&self, id: usize, shm_id: ShmIdentifier)
pub fn shm_set(&self, id: usize, shm_id: ShmIdentifier)
Set Virtual Addr for shared memory
Auto Trait Implementations
impl !RefUnwindSafe for LinuxProcess
impl Send for LinuxProcess
impl Sync for LinuxProcess
impl Unpin for LinuxProcess
impl !UnwindSafe for LinuxProcess
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcefn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
sourcefn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
sourcefn into_result(self) -> Result<T, ZxError>
fn into_result(self) -> Result<T, ZxError>
Performs the conversion.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcefn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
sourcefn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcefn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
sourcefn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcefn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
sourcefn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcefn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
sourcefn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.