summaryrefslogtreecommitdiff
path: root/trans/chroot.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2016-01-23 00:14:56 +0100
committerJustus Winter <justus@gnupg.org>2016-12-23 00:30:04 +0100
commit3eb2edbc3da5c7675940c27a6e75d4526d348fa8 (patch)
treee12f0bb5816db52b1dc2ece46035155f57453fee /trans/chroot.h
parentee4795884ec145303115ac1bd88878684df46118 (diff)
trans: add identity translator
The 'identity' translator is the simplest possible translator. It computes the identity function of Hurdish RPC translations. * trans/Makefile: Add new files. * trans/chroot.c: New file. * trans/chroot.h: Likewise. * trans/identity.c: Likewise.
Diffstat (limited to 'trans/chroot.h')
-rw-r--r--trans/chroot.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/trans/chroot.h b/trans/chroot.h
new file mode 100644
index 00000000..057a251f
--- /dev/null
+++ b/trans/chroot.h
@@ -0,0 +1,34 @@
+#ifndef __HURD_CHROOT_H__
+#define __HURD_CHROOT_H__
+
+struct netnode
+{
+ file_t file; /* port on real file */
+};
+
+struct chroot_node;
+
+error_t chroot_init (void);
+
+/* Make a new virtual node. Always consumes the ports. If
+ successful, NP will be locked. */
+error_t chroot_new_node (file_t file, size_t size, struct node **np);
+
+/* Users must implement this. */
+void chroot_node_norefs (struct node *np);
+
+/* Return the address of the chroot_node for NODE. NODE must have been
+ allocated using chroot_new_node. */
+static inline struct chroot_node *
+chroot_node (struct node *node)
+{
+ return (struct chroot_node *) ((char *) netfs_node_netnode (node)
+ + sizeof (struct netnode));
+}
+
+// XXX
+pthread_mutex_t idport_ihash_lock;
+struct hurd_ihash idport_ihash;
+
+
+#endif /* __HURD_CHROOT_H__ */