Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

io_create (nr 501)

Create a completion port for async I/O.

Signature

io_create(flags: u32) → fd or -errno

Arguments

ArgRegisterDescription
flagsrdiReserved, must be 0

Return value

On success, returns a file descriptor for the new completion port.

Errors

ErrorCondition
EINVALflags is non-zero
EMFILEProcess fd table is full

Description

Creates a new kernel CompletionPort object and returns a file descriptor referring to it. The port fd is used as the first argument to io_submit and io_wait.

Completion ports are the core async I/O primitive in ostoo. Operations (reads, writes, timeouts, IRQ waits, IPC send/recv) are submitted to a port via io_submit and their completions are harvested via io_wait.

Implementation

osl/src/io_port.rssys_io_create

See also