NAME
port_status - returns the status of a port right

SYNOPSIS
#include <mach.h>

kern_return_t port_status(task, port_name, enabled,
num_msgs, backlog, owner, receiver)
task_t task;
port_name_t port_name;
port_set_name_t *enabled; /* out */
int *num_msgs; /* out */
int *backlog; /* out */
boolean_t *owner; /* out */
boolean_t *receiver; /* out */

ARGUMENTS
task The task owning the port right in question.

port_name task’s name for the port right.

enabled Returns task’s name for the port set which the named
port belongs to, or PORT_NULL if it isn’t in a set.

num_msgs The number of messages queued on this port.

backlog The number of messages which may be queued to this
port without causing the sender to block.

owner Returned as true iff the task is the owner of the
port.

receiver Returned as true iff the task is the receiver of the
port.

DESCRIPTION
port_status returns the current status associated with task’s port
right named port_name. If receiver isn’t true, then the enabled,
num_msg, and backlog arguments don’t return anything meaningful.

DIAGNOSTICS
KERN_SUCCESS The call succeeded.

KERN_INVALID_ARGUMENT task was invalid or port_name does
not name a valid port.

SEE ALSO
port_set_backlog(2), port_set_status(2)