⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ProcessBuilder

Struct ProcessBuilder 

Source
pub struct ProcessBuilder { /* private fields */ }
Expand description

Process builder for convenient process creation

Implementations§

Source§

impl ProcessBuilder

Source

pub fn new(name: String) -> Self

Create a new process builder

Source

pub fn parent(self, pid: ProcessId) -> Self

Set parent process

Source

pub fn priority(self, priority: ProcessPriority) -> Self

Set priority

Source

pub fn uid(self, uid: u32) -> Self

Set user ID

Source

pub fn gid(self, gid: u32) -> Self

Set group ID

Source

pub fn build(self) -> Process

Build the process.

Note: The VAS is created but not initialized (no page table root). Callers that need a real address space must call memory_space.lock().init() afterwards (as create_process_with_options does), or clone from an existing address space (as fork_process does).

Source

pub fn build_with_address_space(self) -> Result<Process, KernelError>

Build the process with an initialized address space.

Allocates a root page table frame and maps kernel regions into the new address space. This is the preferred method for creating standalone processes (not forked from an existing process).

Auto Trait Implementations§

§

impl Freeze for ProcessBuilder

§

impl RefUnwindSafe for ProcessBuilder

§

impl Send for ProcessBuilder

§

impl Sync for ProcessBuilder

§

impl Unpin for ProcessBuilder

§

impl UnwindSafe for ProcessBuilder

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

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

Performs the conversion.
§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.