1 <h2>mach_port_mod_refs
</h2>
4 <strong>Function
</strong> - Modify the specified port right's count of user references.
7 <strong>kern_return_t mach_port_mod_refs
</strong>
8 <strong>(ipc_space_t
</strong> <var>task
</var>,
9 <strong>mach_port_name_t
</strong> <var>name
</var>,
10 <strong>mach_port_right_t
</strong> <var>right
</var>,
11 <strong>mach_port_delta_t
</strong> <var>delta
</var><strong>);
</strong>
19 The task holding the right.
24 The task's name for the right.
29 The type of right/entity being modified:
33 <strong>MACH_PORT_RIGHT_SEND
</strong>
36 <strong>MACH_PORT_RIGHT_RECEIVE
</strong>
39 <strong>MACH_PORT_RIGHT_SEND_ONCE
</strong>
42 <strong>MACH_PORT_RIGHT_PORT_SET
</strong>
45 <strong>MACH_PORT_RIGHT_DEAD_NAME
</strong>
51 Signed change to the number of user references.
55 The
<strong>mach_port_mod_refs
</strong> function requests that the number
56 of user references a task has for a right be changed. This results
58 being destroyed, if the
59 number of user references is changed to zero.
61 The
<var>name
</var> parameter
62 should denote the specified right. The number of user references for
63 the right is changed by the amount
<var>delta
</var>, subject to the following
65 port sets, receive rights, and send-once rights may only have
67 The resulting number of user references can't be negative. If the resulting
68 number of user references is zero, the effect is to de-allocate
70 names and send rights, there is an implementation-defined maximum number of
73 If the call destroys the right, then the effect is as described for
74 <strong>mach_port_destroy
</strong>, with the exception that
75 <strong>mach_port_destroy
</strong>
76 simultaneously destroys all
77 the rights denoted by a name, while
<strong>mach_port_mod_refs
</strong>
79 one right. The name will be available for reuse if it only denoted
83 This interface is machine word length specific because of the port name
85 <h3>RETURN VALUES
</h3>
88 <dt> <strong>KERN_INVALID_NAME
</strong>
90 <var>name
</var> did not denote a right.
92 <dt> <strong>KERN_INVALID_RIGHT
</strong>
94 <var>name
</var> denoted a right, but not the specified right.
96 <dt> <strong>KERN_INVALID_VALUE
</strong>
98 The user-reference count would become negative.
100 <dt> <strong>KERN_UREFS_OVERFLOW
</strong>
102 The user-reference count would overflow.
104 <h3>RELATED INFORMATION
</h3>
107 <a href=
"mach_port_destroy.html"><strong>mach_port_destroy
</strong></a>,
108 <a href=
"mach_port_get_refs.html"><strong>mach_port_get_refs
</strong></a>.