Struct kernel::syscall::SystemCall
source · pub struct SystemCall<'a> {
thread: &'a Thread,
}
Expand description
The SystemCall
struct provides an interface for invoking system calls on a given thread.
Fields§
§thread: &'a Thread
Implementations§
source§impl SystemCall<'_>
impl SystemCall<'_>
source§impl SystemCall<'_>
impl SystemCall<'_>
sourcepub fn sys_exit(&self, exit_code: usize) -> (isize, ControlFlow)
pub fn sys_exit(&self, exit_code: usize) -> (isize, ControlFlow)
Terminates the current thread with the given exit code.
sourcepub fn sys_sched_yield(&self) -> (isize, ControlFlow)
pub fn sys_sched_yield(&self) -> (isize, ControlFlow)
Yields the CPU to another thread.
sourcepub fn sys_fork(&self) -> (isize, ControlFlow)
pub fn sys_fork(&self) -> (isize, ControlFlow)
Forks the current process and create a new child process.
sourcepub async fn sys_waitpid(
&self,
pid: isize,
wait_status: UserPtr<usize>
) -> (isize, ControlFlow)
pub async fn sys_waitpid( &self, pid: isize, wait_status: UserPtr<usize> ) -> (isize, ControlFlow)
Waits for a child process with the given process to terminate, and return the PID and exit.
source§impl SystemCall<'_>
impl SystemCall<'_>
sourcepub fn sys_get_time(&self) -> (isize, ControlFlow)
pub fn sys_get_time(&self) -> (isize, ControlFlow)
Returns the current system time in milliseconds.