zx_port_queue

NAME

Queue a packet to a port.

SYNOPSIS

  1. #include <zircon/syscalls.h>
  2. #include <zircon/syscalls/port.h>
  3. zx_status_t zx_port_queue(zx_handle_t handle, const zx_port_packet_t* packet);

DESCRIPTION

zx_port_queue() queues a user packet to the port specified by handle.

User packets are drained by zx_port_wait(). Failure to drain packets in a timely fashion can cause excessive kernel memory to be used, which might generate an exception. See ipc limits for details.

  1. typedef struct zx_port_packet {
  2. uint64_t key;
  3. uint32_t type;
  4. zx_status_t status;
  5. union {
  6. zx_packet_user_t user;
  7. zx_packet_signal_t signal;
  8. };
  9. } zx_port_packet_t;

In packet type should be ZX_PKT_TYPE_USER and only the user union element is considered valid:

  1. typedef union zx_packet_user {
  2. uint64_t u64[4];
  3. uint32_t u32[8];
  4. uint16_t u16[16];
  5. uint8_t c8[32];
  6. } zx_packet_user_t;

RIGHTS

handle must be of type ZX_OBJ_TYPE_PORT and have ZX_RIGHT_WRITE.

RETURN VALUE

zx_port_queue() returns ZX_OK on successful queue of a packet.

ERRORS

ZX_ERR_BAD_HANDLE handle isn’t a valid handle

ZX_ERR_INVALID_ARGS packet is an invalid pointer.

ZX_ERR_WRONG_TYPE handle is not a port handle.

ZX_ERR_ACCESS_DENIED handle does not have ZX_RIGHT_WRITE.

SEE ALSO