[−][src]Struct sunrise_libuser::types::Process
A Process. Created with create_process
syscall, or by calling
Process::current().
Implementations
impl Process
[src]
fn current() -> Process
[src]
Gets the current process handle. Uses the 0xFFFF8001 meta-handle, which may not be valid in all contexts!
pub fn start(
&self,
main_thread_prio: u32,
default_cpuid: u32,
main_thread_stack_sz: u32
) -> Result<(), Error>
[src]
&self,
main_thread_prio: u32,
default_cpuid: u32,
main_thread_stack_sz: u32
) -> Result<(), Error>
Start the given process on the provided CPU with the provided scheduler priority.
A stack of the given size will be allocated using the process' memory resource limit and memory pool.
The entrypoint is assumed to be the first address of the code_addr
region
provided in create_process
. It
takes two parameters: the first is the usermode exception handling
context, and should always be NULL. The second is a handle to the main
thread.
Errors
InvalidProcessorId
- Attempted to start the process on a processor that doesn't exist on the current machine, or a processor that the process is not allowed to use.
InvalidThreadPriority
- Attempted to use a priority above 0x3F, or a priority that the created process is not allowed to use.
MemoryFull
- Provided stack size is bigger than available vmem space.
pub fn state(&self) -> Result<ProcessState, Error>
[src]
Get the state the given process is currently in.
Shouldn't ever return an error, unless the user is doing weird things with handles.
pub fn wait_async(
&self,
queue: WorkQueue
) -> impl Future<Output = Result<(), Error>> + Unpin
[src]
&self,
queue: WorkQueue
) -> impl Future<Output = Result<(), Error>> + Unpin
Waits for the process to change state. Use Process::state to get the new state and Process::reset_signal to reset the signaled state.
Panics
Panics if used from outside the context of a Future spawned on a libuser future executor. Please make sure you only call this function from a future spawned on a WaitableManager.
pub fn reset_signal(&self) -> Result<(), Error>
[src]
Clear the "signaled" state of a process. A process moves to the signaled
state when it changes ProcessState
(e.g. when exiting).
Note that once a Process enters the Exited state, it is permanently
signaled and cannot be reset. Calling reset_signal
will return an
InvalidState error.
Errors
InvalidState
- The event wasn't signaled.
- The process was in Exited state.
pub fn pid(&self) -> Result<Pid, Error>
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnwindSafe for Process
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SizedIPCBuffer for T
[src]
fn size(&Self) -> usize
[src]
fn is_cool(usize, usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(usize, usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(usize, usize) -> &'a mut T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,