SyscallNumber

Enum SyscallNumber 

Source
#[repr(usize)]
pub enum SyscallNumber {
Show 22 variants Exit = 0, Open = 1, Read = 2, Write = 3, Seek = 4, Tell = 5, Close = 6, Pipe = 7, Mmap = 8, Munmap = 9, Fork = 10, ThreadCreate = 11, ThreadJoin = 12, ExitGroup = 13, Create = 14, Mkdir = 15, Unlink = 16, Chdir = 17, Readdir = 18, Stat = 19, Fsync = 20, GetPhys = 129,
}
Expand description

Represents system call numbers used in project5.

Each variant corresponds to a specific system call that can be invoked using the system call interface. The numeric values align with the syscall table in the operating system.

Variants§

§

Exit = 0

Terminates the calling thread.

§

Open = 1

Opens a file and returns a file descriptor.

§

Read = 2

Reads data from a file descriptor.

§

Write = 3

Writes data to a file descriptor.

§

Seek = 4

Moves the file offset of an open file.

§

Tell = 5

Retrieves the current file offset.

§

Close = 6

Closes an open file descriptor.

§

Pipe = 7

Create an interprocess communication channel.

§

Mmap = 8

Map the memory.

§

Munmap = 9

Unmap the memory.

§

Fork = 10

Fork the process.

§

ThreadCreate = 11

Create a thread.

§

ThreadJoin = 12

Join a Thread.

§

ExitGroup = 13

Terminates the process, by terminating all threads.

§

Create = 14

Create a regular file.

§

Mkdir = 15

Make a directory.

Unlink a file.

§

Chdir = 17

Change the current working directory.

§

Readdir = 18

Read the contents of a directory.

§

Stat = 19

Stat a file.

§

Fsync = 20

Synchronize a file’s in-memory state with disk.

§

GetPhys = 129

Get Physical Address of Page (for grading purposes only)

Trait Implementations§

Source§

impl TryFrom<usize> for SyscallNumber

Source§

type Error = KernelError

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

fn try_from(no: usize) -> Result<SyscallNumber, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for SyscallNumber

§

impl RefUnwindSafe for SyscallNumber

§

impl Send for SyscallNumber

§

impl Sync for SyscallNumber

§

impl Unpin for SyscallNumber

§

impl UnwindSafe for SyscallNumber

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.