summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-05-14 19:10:05 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-05-14 19:10:05 +0000
commitb57fad22c148ccfb8848822d550b5f8c6b9febbf (patch)
tree9afa644afa803da43d88361d19b366e3e30f5c34 /pfinet
parent0e3fdef885b88bd7277bb6db8e2070c088aeeee1 (diff)
(S_io_identity): New function.
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/io-ops.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index 3dcd2123..1eaae9bd 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -460,6 +460,41 @@ S_io_duplicate (struct sock_user *user,
return 0;
}
+error_t
+S_io_identity (struct sock_user *user,
+ mach_port_t *id,
+ mach_msg_type_name_t *idtype,
+ mach_port_t *fsys,
+ mach_msg_type_name_t *fsystype,
+ int *fileno)
+{
+ error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+
+ mutex_lock (&global_lock);
+ if (user->sock->identity == MACH_PORT_NULL)
+ {
+ err = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE,
+ &user->sock->identity);
+ if (err)
+ {
+ mutex_unlock (&global_lock);
+ return err;
+ }
+ }
+
+ *id = user->sock->identity;
+ *idtype = MACH_MSG_TYPE_MAKE_SEND;
+ *fsys = fsys_identity;
+ *fsystype = MACH_MSG_TYPE_MAKE_SEND;
+ *fileno = (ino_t) user->sock; /* matches S_io_stat above */
+
+ mutex_unlock (&global_lock);
+ return 0;
+}
+
error_t