port_create - create an IO port
#include <zircon/syscalls.h>
zx_status_t zx_port_create(uint32_t options, zx_handle_t* out);
port_create() creates an port; a waitable object that can be used to read packets queued by kernel or by user-mode.
If you need this port to be bound to an interrupt, pass ZX_PORT_BIND_TO_INTERRUPTto options, otherwise it should be 0.
In the case where a port is bound to an interrupt, the interrupt packets are delivered via a dedicated queue on ports and are higher priority than other non-interrupt packets.
The returned handle will have ZX_RIGHT_TRANSFER (allowing them to be sent to another process via channel write), ZX_RIGHT_WRITE (allowing packets to be queued), ZX_RIGHT_READ (allowing packets to be read) and ZX_RIGHT_DUPLICATE (allowing them to be duplicated).
TODO(ZX-2399)
port_create() returns ZX_OK and a valid IO port handle via out on success. In the event of failure, an error value is returned.
ZX_ERR_INVALID_ARGS options has an invalid value, or out is an invalid pointer or NULL.
ZX_ERR_NO_MEMORY Failure due to lack of memory. There is no good way for userspace to handle this (unlikely) error. In a future build this error will no longer occur.
port_queue, port_wait, object_wait_async, handle_close, handle_duplicate, handle_replace.