[][src]Enum syscall::io_uring::v1::StandardOpcode

#[repr(u8)]#[non_exhaustive]pub enum StandardOpcode {
    NoOp,
    Open,
    Close,
    Read,
    Write,
    Seek,
    Fstat,
    Fstatvfs,
    Mmap,
    Munmap,
    Fsync,
    FilesUpdate,
    RegularSyscall,
}

The standard opcodes, which are a superset of the filesystem (scheme-compatible) syscalls. Opcodes with a value above 127 are specific to the producer; the kernel for example, also has syscalls for managing memory and processes, while a userspace producer such as nvmed can provide custom messages for things like TRIM.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoOp

A no-operation, using only the implicit fields. Useful for testing or benchmarking io_uring operation.

Open

A call that opens a file, given a path represented as a string. Uses all implicit fields.

required fieldusage descriptionSIZE
syscall_flagsOpenFlagsBOTH
addra pointer to a buffer containing the pathBOTH
lenthe length of the buffer containing the pathBOTH
fdif OPEN_AT, points to an fd referencing the parentBOTH
offsetfcntl flags (upper), file mode if O_CREAT (lower)BOTH
additional1not used/producer specific64
additional2not used/producer specific64
Close

A call that closes a file, flushing required buffers if told to. Uses all implicit fields. On failure, returns the number of successfully closed file descriptors, or zero unless CLOSE_MANY.

required fieldusage descriptionSIZE
syscall_flagsCloseFlagsBOTH
addrnot used/producer specificBOTH
lenif CLOSE_MANY, gives the count of the range of fdsBOTH
fdthe file descriptor to close, or start if CLOSE_MANYBOTH
offsetnot used/producer specificBOTH
additional1not used/producer specific64
additional2not used/producer specific64
Read

A call that reads bytes from a file descriptor. Uses all implicit fields.

required fieldusage descriptionSIZE
syscall_flagsReadFlagsBOTH
addrthe address to read intoBOTH
lenthe number of iovecs if VECTORED, otherwise the sizeBOTH
fdthe file descriptor to read fromBOTH
offsetthe offset to read from unless CHANGE_OFFSETBOTH
additional1not used/producer specific64
additional2not used/producer specific64
Write

A call that reads bytes from a file. Uses all implicit fields.

required fieldusage descriptionSIZE
syscall_flagsWriteFlagsBOTH
addrthe address to write fromBOTH
lenthe number of iovecs if VECTORED, otherwise the sizeBOTH
fdthe file descriptor to write toBOTH
offsetthe offset to write to unless CHANGE_OFFSETBOTH
additional1not used/producer specific64
additional2not used/producer specific64
Seek

A call that changes the current file offset. Uses all implicit fields.

required fieldusage descriptionSIZE
syscall_flagswhence arg (SEEK_SET, SEEK_END, or SEEK_CURBOTH
addrnot used/producer specificBOTH
lennot used/producer specificBOTH
fdthe file descriptor which offset will be changedBOTH
offseta signed integer which is added to the offset from whenceBOTH
additional1not used/producer specific64
additional2not used/producer specific64
Fstat

TODO

Fstatvfs

TODO

Mmap

TODO

Munmap

TODO

Fsync

TODO

FilesUpdate

A call that when submitted, sends one completion entry for every update to a file or set of files, when the update matched the specific flags. If the flags field contains IoUringSqeFlags::SUBSCRIBE, there will be one completio for each event, otherwise only a single event. Uses all implicit fields.

required fieldusage descriptionSIZE
syscall_flagsFilesUpdateFlagsBOTH
addrif MULTI, the address of an array of fdsBOTH
fdif not MULTI, the fd to follow, otherwise unusedBOTH
offsetnot used/producer specificBOTH
lenif MULTI, the number of fds in the arrayBOTH
additional1not used/producer specifc64
additional2not used/producer specific64
RegularSyscall

A syscall where the four syscall parameters, namely the number (a), b, c, and d, all are passed through as if they were a regular scheme packet. The size of file descriptors will be limited to 32 bits if SqEntry32 is used. Uses all implicit fields. This allows talking to schemes asynchronously and without blocking, for other syscalls than read and write, with a proper wakeup system.

required fieldusage descriptionSIZE
syscall_flagsfcntl F_SETFL flags, e.g. O_NONBLOCK or O_DIRECTBOTH
addrthe "a" field of the syscall, which is the syscall numberBOTH
fdthe "b" field, which typically is the file descriptorBOTH
offsetthe "c" field, which usually is the pointer to a bufferBOTH
lenthe "d" field, which usually is the length of a bufferBOTH
additional1the "e" field (not scheme compatible yet)64
additional2the "f" field (not scheme compatible yet)64

Implementations

impl StandardOpcode[src]

pub const MAX_OPCODE: u8[src]

The highest opcode number that is reserved to standard opcodes.

pub fn from_raw(raw: u8) -> Option<Self>[src]

Trait Implementations

impl Clone for StandardOpcode[src]

impl Copy for StandardOpcode[src]

impl Debug for StandardOpcode[src]

impl Eq for StandardOpcode[src]

impl Hash for StandardOpcode[src]

impl PartialEq<StandardOpcode> for StandardOpcode[src]

impl StructuralEq for StandardOpcode[src]

impl StructuralPartialEq for StandardOpcode[src]

Auto Trait Implementations

impl Send for StandardOpcode

impl Sync for StandardOpcode

impl Unpin for StandardOpcode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.