io_port_create - create an IO port
#include <magenta/syscalls.h>
mx_handle_t mx_io_port_create(uint32_t options);
io_port_create() creates an IO port; a waitable object that can be used to read IO packets queued by kernel or by user-mode.
options are MX_IOPORT_OPT_128_SLOTS for creating an IO port with maximum capacity of 128 outstanding packets or MX_IOPORT_OPT_1K_SLOTS for creating an IO port with a 1024 outstanding packet capacity.
The returned handle will have MX_RIGHT_TRANSFER (allowing them to be sent to another process via message pipe write), MX_RIGHT_WRITE (allowing packets to be queued), MX_RIGHT_READ (allowing packets to be read) and MX_RIGHT_DUPLICATE (allowing them to be duplicated).
io_port_create() returns a valid IO port handle (positive) on success. In the event of failure, a negative error value is returned. Zero (the "invalid handle") is never returned.
ERR_INVALID_ARGS options has an invalid value.
ERR_NO_MEMORY (Temporary) Failure due to lack of memory.
io_port_queue. io_port_wait. io_port_bind. handle_close. handle_duplicate.