summaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-06-15 22:43:24 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-06-15 22:43:24 +0000
commit76238970f418511cbca3b8a6c709593b04004a7e (patch)
tree97a7393e54e2f82522c406e2fa6c7f257cf1b718 /libtrivfs
parent1c163643a516facf3d2c0ad241ebf49c1519fc45 (diff)
Formerly migsupport.c.~2~
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/migsupport.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/libtrivfs/migsupport.c b/libtrivfs/migsupport.c
index e5528118..814d931a 100644
--- a/libtrivfs/migsupport.c
+++ b/libtrivfs/migsupport.c
@@ -20,7 +20,18 @@
struct trivfs_protid *
_trivfs_begin_using_protid (mach_port_t port)
{
- return ports_check_port_type (port, trivfs_protid_porttype);
+ if (trivfs_protid_nporttypes > 1)
+ {
+ struct port_info *pi = ports_get_port (port);
+ int i;
+ for (i = 0; i < trivfs_protid_nporttypes, i++)
+ if (pi->type == trivfs_protid_porttypes[i])
+ return (struct trivfs_protid *) pi;
+ ports_done_with_port (port);
+ return 0;
+ }
+ else
+ return ports_check_port_type (port, trivfs_protid_porttypes[0]);
}
void
@@ -28,3 +39,26 @@ _trivfs_end_using_protid (struct trivfs_protid *cred)
{
ports_done_with_port (cred);
}
+
+struct trivfs_control *
+_trivfs_begin_using_control (mach_port_t port)
+{
+ if (trivfs_control_nporttypes > 1)
+ {
+ struct port_info *pi = ports_get_port (port);
+ int i;
+ for (i = 0; i < trivfs_control_nporttypes, i++)
+ if (pi->type == trivfs_control_porttypes[i])
+ return (struct trivfs_control *) pi;
+ ports_done_with_port (port);
+ return 0;
+ }
+ else
+ return ports_check_port_type (port, trivfs_control_porttypes[0]);
+}
+
+void
+_trivfs_end_using_control (struct trivfs_control *cred)
+{
+ ports_done_with_port (cred);
+}