+ }
+
+ return rv;
+}
+
+extern kern_return_t
+_kernelrpc_mach_voucher_extract_attr_recipe(
+ mach_port_name_t voucher,
+ mach_voucher_attr_key_t key,
+ mach_voucher_attr_raw_recipe_t recipe,
+ mach_msg_type_number_t *recipe_size);
+
+kern_return_t
+mach_voucher_extract_attr_recipe(
+ mach_port_name_t voucher,
+ mach_voucher_attr_key_t key,
+ mach_voucher_attr_raw_recipe_t recipe,
+ mach_msg_type_number_t *recipe_size)
+{
+ kern_return_t rv;
+
+ rv = mach_voucher_extract_attr_recipe_trap(voucher, key, recipe, recipe_size);
+
+ if (rv == MACH_SEND_INVALID_DEST) {
+ rv = _kernelrpc_mach_voucher_extract_attr_recipe(voucher, key, recipe, recipe_size);
+ }
+
+ return rv;
+}
+
+
+kern_return_t
+thread_destruct_special_reply_port(
+ mach_port_name_t port,
+ thread_destruct_special_reply_port_rights_t rights)
+{
+ switch (rights) {
+ case THREAD_SPECIAL_REPLY_PORT_ALL:
+ return mach_port_destruct(mach_task_self(), port, -1, 0);
+
+ case THREAD_SPECIAL_REPLY_PORT_RECEIVE_ONLY:
+ return mach_port_destruct(mach_task_self(), port, 0, 0);
+
+ case THREAD_SPECIAL_REPLY_PORT_SEND_ONLY:
+ return mach_port_deallocate(mach_task_self(), port);