mach_reply_port


System Trap - Allocate a new port and insert corresponding receive right in the calling task.

SYNOPSIS

#include<mach/mach_traps.h>

mach_port_t   mach_reply_port( void )

PARAMETERS

None.

DESCRIPTION

The mach_reply_port function creates a new port for the current task and returns the name assigned by the kernel. The kernel records the name in the task's port name space and grants the task receive rights for the port. The new port is not a member of any port set.

This function is an optimized version of mach_port_allocate that uses no port references. Its main purpose is to allocate a reply port for the task when the task is starting, for example, before it has any ports to use as reply ports for any IPC-based system functions.

If the task's task self port is null (thereby deactivating basic Mach manipulations by the task), this call returns null.

CAUTIONS

Although the created port can be used for any purpose, the implementation may optimize its use as a reply port.

RETURN VALUES

MACH_PORT_NULL
No port was allocated.

[reply receive right]
Any other value indicates success.

RELATED INFORMATION

Functions: mach_port_allocate.