1 <h2>mach_port_allocate
</h2>
4 <strong>Function
</strong> - Create caller-specified type of port right.
7 <strong>kern_return_t mach_port_allocate
</strong>
8 <strong>(ipc_space_t
</strong> <var>task
</var>,
9 <strong>mach_port_right_t
</strong> <var>right
</var>,
10 <strong>mach_port_name_t
</strong> <var>*name
</var><strong>);
</strong>
18 The task acquiring the port right.
23 The kind of entity to be created. This is one of the following:
26 <dt> <strong>MACH_PORT_RIGHT_RECEIVE
</strong>
28 <strong>mach_port_allocate
</strong> creates a port. The new port is not a
29 member of any port set. It doesn't have any extant send or
30 send-once rights. Its make-send count is zero, its sequence
31 number is zero, its queue limit is
<strong>MACH_PORT_QLIMIT_DEFAULT
</strong>, and
32 it has no queued messages.
<var>name
</var> denotes the
33 receive right for the new port.
34 <var>task
</var> does not hold send rights for the new port, only the
35 receive right.
<strong>mach_port_insert_right
</strong> and
36 <strong>mach_port_extract_right
</strong> can be used to convert the receive right into a
37 combined send/receive right.
39 <dt> <strong>MACH_PORT_RIGHT_PORT_SET
</strong>
41 <strong>mach_port_allocate
</strong> creates a port set. The new port set has
44 <dt> <strong>MACH_PORT_RIGHT_DEAD_NAME
</strong>
46 <strong>mach_port_allocate
</strong> creates a dead name. The new dead
47 name has one user reference.
53 The task's name for the port right. This can be any name
58 The
<strong>mach_port_allocate
</strong> function creates a new right
59 in the specified task. The new right's name is returned in name.
61 Ports that are allocated via this call do not support the full set of
62 Mach port semantics; in particular, the kernel will not provide no-more-senders
63 notification service requests on such ports. Any attempt to request no-more-senders
65 will generate an error. Use the
<strong>mach_port_allocate_full
</strong>
66 interface to allocate ports that support the full set of Mach port semantics.
69 This interface is machine word length specific because of the port name
71 <h3>RETURN VALUES
</h3>
74 <dt> <strong>KERN_NO_SPACE
</strong>
76 There was no room in task's IPC name space for another right.
78 <h3>RELATED INFORMATION
</h3>
81 <a href=
"mach_port_allocate_name.html"><strong>mach_port_allocate_name
</strong></a>,
82 <a href=
"mach_port_deallocate.html"><strong>mach_port_deallocate
</strong></a>,
83 <a href=
"mach_port_insert_right.html"><strong>mach_port_insert_right
</strong></a>,
84 <a href=
"mach_port_extract_right.html"><strong>mach_port_extract_right
</strong></a>.