SyscallNumber

Enum SyscallNumber 

Source
#[repr(usize)]
pub enum SyscallNumber { Exit = 0, Open = 1, Read = 2, Write = 3, Seek = 4, Tell = 5, Close = 6, Pipe = 7, Mmap = 8, Munmap = 9, }
Expand description

Represents system call numbers used in project2

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 process.

§

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.

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.