+ipc_entries_hold(
+ ipc_space_t space,
+ uint32_t entries_needed)
+{
+
+ ipc_entry_t table;
+ mach_port_index_t next_free = 0;
+ uint32_t i;
+
+ assert(is_active(space));
+
+ table = &space->is_table[0];
+
+ for (i = 0; i < entries_needed; i++) {
+ next_free = table[next_free].ie_next;
+ if (next_free == 0) {
+ return KERN_NO_SPACE;
+ }
+ assert(next_free < space->is_table_size);
+ assert(table[next_free].ie_object == IO_NULL);
+ }
+ return KERN_SUCCESS;
+}
+
+/*
+ * Routine: ipc_entry_claim
+ * Purpose:
+ * Take formal ownership of a held entry.
+ * Conditions:
+ * The space is write-locked and active throughout.
+ * An object may be locked. Will not allocate memory.
+ *
+ * Note: The returned entry must be marked as modified before
+ * releasing the space lock
+ */
+
+kern_return_t
+ipc_entry_claim(