summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtrivfs/mig-decls.h6
-rw-r--r--term/mig-mutate.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/libtrivfs/mig-decls.h b/libtrivfs/mig-decls.h
index 230af239..f3afd5ae 100644
--- a/libtrivfs/mig-decls.h
+++ b/libtrivfs/mig-decls.h
@@ -75,6 +75,12 @@ trivfs_end_using_protid (struct trivfs_protid *cred)
ports_port_deref (cred);
}
+static inline mach_port_t __attribute__ ((unused))
+trivfs_convert_to_port(struct trivfs_protid *protid)
+{
+ return protid->pi.port_right;
+}
+
static inline struct trivfs_control * __attribute__ ((unused))
trivfs_begin_using_control (mach_port_t port)
{
diff --git a/term/mig-mutate.h b/term/mig-mutate.h
index af8877e2..9fcdbbc8 100644
--- a/term/mig-mutate.h
+++ b/term/mig-mutate.h
@@ -22,6 +22,7 @@
#define IO_INTRAN trivfs_protid_t trivfs_begin_using_protid (io_t)
#define IO_INTRAN_PAYLOAD trivfs_protid_t trivfs_begin_using_protid_payload
#define IO_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
+#define IO_OUTTRAN io_t trivfs_convert_to_port (trivfs_protid_t)
#define CTTY_INTRAN \
port_info_t begin_using_ctty_port (mach_port_t)