]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/mach/mach_port.c
xnu-6153.81.5.tar.gz
[apple/xnu.git] / libsyscall / mach / mach_port.c
index 52f731b9997edb02b4c208dd64c6a43cb684782f..57d67509466e616870fe0f203631cc25dbd7ca86 100644 (file)
@@ -33,6 +33,7 @@
 #include <mach/mach_sync_ipc.h>
 #include "tsd.h"
 
 #include <mach/mach_sync_ipc.h>
 #include "tsd.h"
 
+
 kern_return_t
 mach_port_names(
        ipc_space_t task,
 kern_return_t
 mach_port_names(
        ipc_space_t task,
@@ -57,7 +58,11 @@ mach_port_type(
 {
        kern_return_t rv;
 
 {
        kern_return_t rv;
 
-       rv = _kernelrpc_mach_port_type(task, name, ptype);
+       rv = _kernelrpc_mach_port_type_trap(task, name, ptype);
+
+       if (rv == MACH_SEND_INVALID_DEST) {
+               rv = _kernelrpc_mach_port_type(task, name, ptype);
+       }
 
        return rv;
 }
 
        return rv;
 }
@@ -246,9 +251,14 @@ mach_port_request_notification(
 {
        kern_return_t rv;
 
 {
        kern_return_t rv;
 
-       rv = _kernelrpc_mach_port_request_notification(task, name, msgid,
+       rv = _kernelrpc_mach_port_request_notification_trap(task, name, msgid,
            sync, notify, notifyPoly, previous);
 
            sync, notify, notifyPoly, previous);
 
+       if (rv == MACH_SEND_INVALID_DEST) {
+               rv = _kernelrpc_mach_port_request_notification(task, name, msgid,
+                   sync, notify, notifyPoly, previous);
+       }
+
        return rv;
 }
 
        return rv;
 }
 
@@ -744,3 +754,31 @@ thread_destruct_special_reply_port(
                return KERN_INVALID_ARGUMENT;
        }
 }
                return KERN_INVALID_ARGUMENT;
        }
 }
+
+kern_return_t
+mach_port_guard_with_flags(
+       ipc_space_t             task,
+       mach_port_name_t        name,
+       mach_port_context_t     guard,
+       uint64_t                flags)
+{
+       kern_return_t rv;
+
+       rv = _kernelrpc_mach_port_guard_with_flags(task, name, (uint64_t) guard, flags);
+
+       return rv;
+}
+
+kern_return_t
+mach_port_swap_guard(
+       ipc_space_t             task,
+       mach_port_name_t        name,
+       mach_port_context_t     old_guard,
+       mach_port_context_t     new_guard)
+{
+       kern_return_t rv;
+
+       rv = _kernelrpc_mach_port_swap_guard(task, name, (uint64_t)old_guard, (uint64_t)new_guard);
+
+       return rv;
+}