- assert(ip_active(port) && IKOT_AU_SESSIONPORT == ip_kotype(port));
- sendport = ipc_port_make_send(port);
-
- /*
- * If we don't have a no-senders notification outstanding against
- * the port, take a reference on the session and request one.
- */
- if (IP_NULL == port->ip_nsrequest) {
- ipc_port_t notifyport;
-
- audit_session_aiaref(aia_p);
-
-
- ip_lock(port);
- /* Need a send-once right for the target of the notification */
- notifyport = ipc_port_make_sonce_locked(port);
- /* Request a no-senders notification (at the new make-send threshold) */
- ipc_port_nsrequest(port, port->ip_mscount, notifyport, ¬ifyport);
- /* port unlocked */
-
- if (IP_NULL != notifyport) {
- /* race requesting notification */
- audit_session_aiaunref(aia_p);
- ipc_port_release_sonce(notifyport);
- }
- }
-
- return (sendport);