summaryrefslogtreecommitdiff
path: root/trans/chroot.h
diff options
context:
space:
mode:
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__ */