summaryrefslogtreecommitdiff
path: root/fsys_proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsys_proxy.c')
-rw-r--r--fsys_proxy.c159
1 files changed, 159 insertions, 0 deletions
diff --git a/fsys_proxy.c b/fsys_proxy.c
new file mode 100644
index 0000000..0af04ac
--- /dev/null
+++ b/fsys_proxy.c
@@ -0,0 +1,159 @@
+/* A proxy for fsys messages.
+
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ Written by Justus Winter <4winter@informatik.uni-hamburg.de>
+
+ This file might one day be a part of the GNU Hurd.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "priv.h"
+
+#include <hurd/fsys.h>
+
+error_t
+S_fsys_startup (mach_port_t bootstrap, int flags, mach_port_t control,
+ mach_port_t *real, mach_msg_type_name_t *realtype)
+{
+ error_t err;
+
+ if (failures == 0)
+ {
+ /* This is our first child, do the rendezvous on our bootstrap
+ port. */
+ err = fsys_startup (our_bootstrap,
+ flags,
+ reincarnation_port,
+ MACH_MSG_TYPE_COPY_SEND,
+ real);
+ if (err)
+ return err;
+
+ /* Steal the underlying node. */
+ node = *real;
+ }
+ else
+ /* Provide the underlying node. */
+ *real = node;
+
+ /* Always create a copy. */
+ *realtype = MACH_MSG_TYPE_COPY_SEND;
+
+ /* Update the control port. */
+ active_control = control;
+
+ if (failures > 0)
+ {
+ /* Reinstall the translator. */
+ err = install_translator ();
+ if (err)
+ return err;
+ }
+
+ err = register_dead_name_notification ();
+ if (err)
+ return err;
+
+ return err;
+}
+
+error_t
+S_fsys_getroot (mach_port_t fsys_t,
+ mach_port_t dotdotnode,
+ uid_t *uids, size_t nuids,
+ uid_t *gids, size_t ngids,
+ int flags,
+ retry_type *do_retry,
+ char *retry_name,
+ mach_port_t *ret,
+ mach_msg_type_name_t *rettype)
+{
+ *rettype = MACH_MSG_TYPE_MOVE_SEND;
+ return fsys_getroot (active_control,
+ dotdotnode, MACH_MSG_TYPE_MOVE_SEND,
+ uids, nuids,
+ gids, ngids,
+ flags,
+ do_retry,
+ retry_name,
+ ret);
+}
+
+error_t
+S_fsys_goaway (mach_port_t control, int flags)
+{
+ /* XXX we never get to see those... */
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_syncfs (mach_port_t control,
+ int wait,
+ int recurse)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_set_options (mach_port_t control,
+ char *data, mach_msg_type_number_t len,
+ int do_children)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_get_options (mach_port_t control,
+ char **data, mach_msg_type_number_t *len)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_getfile (mach_port_t control,
+ uid_t *uids, size_t nuids,
+ uid_t *gids, size_t ngids,
+ char *handle, size_t handllen,
+ mach_port_t *pt,
+ mach_msg_type_name_t *pttype)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_getpriv (mach_port_t control,
+ mach_port_t *host_priv, mach_msg_type_name_t *host_priv_type,
+ mach_port_t *dev_master, mach_msg_type_name_t *dev_master_type,
+ task_t *fs_task, mach_msg_type_name_t *fs_task_type)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_init (mach_port_t control,
+ mach_port_t reply,
+ mach_msg_type_name_t replytype,
+ mach_port_t proc,
+ auth_t auth)
+{
+ return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_forward (mach_port_t server, mach_port_t requestor,
+ char *argz, size_t argz_len)
+{
+ return EOPNOTSUPP;
+}