From 3eb2edbc3da5c7675940c27a6e75d4526d348fa8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 23 Jan 2016 00:14:56 +0100 Subject: 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. --- trans/chroot.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 trans/chroot.h (limited to 'trans/chroot.h') 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__ */ -- cgit v1.2.3