#[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,
Fork = 10,
GetPhys = 129,
}Expand description
Represents system call numbers used in project3.
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.
Fork = 10
Fork the process.
GetPhys = 129
Get Physical Address of Page (for grading purposes only)
Trait Implementations§
Source§impl Debug for SyscallNumber
impl Debug for SyscallNumber
Source§impl TryFrom<usize> for SyscallNumber
impl TryFrom<usize> for SyscallNumber
Source§type Error = KernelError
type Error = KernelError
The type returned in the event of a conversion error.
Source§fn try_from(no: usize) -> Result<SyscallNumber, Self::Error>
fn try_from(no: usize) -> Result<SyscallNumber, Self::Error>
Performs the conversion.