+
+/*
+ * Guard an already existing port. Allows guarding
+ * receive rights only. Uses the context field in the
+ * port structure to store the guard.
+ */
+routine mach_port_guard_with_flags(
+ task : ipc_space_t;
+ name : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+ guard : mach_port_context_t;
+#else
+ guard : uint64_t;
+#endif
+ flags : uint64_t);
+
+/*
+ * Swap guard value of an existing guarded port. Works
+ * only if it is not a strict guard.
+ */
+routine mach_port_swap_guard(
+ task : ipc_space_t;
+ name : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+ old_guard : mach_port_context_t;
+#else
+ old_guard : uint64_t;
+#endif
+
+#ifdef LIBSYSCALL_INTERFACE
+ new_guard : mach_port_context_t);
+#else
+ new_guard : uint64_t);
+#endif
+
+/*
+ * Return the type and address of the kernel object
+ * that the given send/receive right represents.
+ * This call is only valid on MACH_IPC_DEBUG kernels.
+ * Otherwise, KERN_FAILURE is returned.
+ */
+routine
+#ifdef KERNEL_SERVER
+mach_port_kobject_description_from_user(
+ port : mach_port_t;
+#else
+mach_port_kobject_description(
+ task : ipc_space_read_t;
+#endif
+ name : mach_port_name_t;
+ out object_type : natural_t;
+ out object_addr : mach_vm_address_t;
+ out description : kobject_description_t);
+