bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 8/9] poc /servers/startup


From: Justus Winter
Subject: [PATCH 8/9] poc /servers/startup
Date: Mon, 23 Sep 2013 13:03:30 +0200

---
 startup/Makefile  |    2 +-
 startup/startup.c |  124 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+), 1 deletion(-)

diff --git a/startup/Makefile b/startup/Makefile
index 277fee4..23d35cb 100644
--- a/startup/Makefile
+++ b/startup/Makefile
@@ -21,7 +21,7 @@ makemode := server
 SRCS = startup.c
 OBJS = $(SRCS:.c=.o) \
        startupServer.o notifyServer.o startup_replyUser.o msgServer.o \
-       startup_notifyUser.o
+       startup_notifyUser.o fsysServer.o
 target = startup
 HURDLIBS = shouldbeinlibc
 
diff --git a/startup/startup.c b/startup/startup.c
index fd5f1c2..e2393a9 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -415,9 +415,11 @@ demuxer (mach_msg_header_t *inp,
   extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
   extern int startup_server (mach_msg_header_t *, mach_msg_header_t *);
   extern int msg_server (mach_msg_header_t *, mach_msg_header_t *);
+  extern int fsys_server (mach_msg_header_t *, mach_msg_header_t *);
 
   return (notify_server (inp, outp) ||
          msg_server (inp, outp) ||
+         fsys_server (inp, outp) ||
          startup_server (inp, outp));
 }
 
@@ -494,6 +496,15 @@ main (int argc, char **argv, char **envp)
   /* Crash if the boot filesystem task dies.  */
   request_dead_name (fstask);
 
+  file_t node = file_name_lookup ("/servers/startup", 0, 0666);
+  if (node != MACH_PORT_NULL)
+    {
+      file_set_translator (node,
+                           0, FS_TRANS_SET, 0,
+                           NULL, 0,
+                           startup, MACH_MSG_TYPE_COPY_SEND);
+    }
+
   /* Set up the set of ports we will pass to the programs we exec.  */
   for (i = 0; i < INIT_PORT_MAX; i++)
     switch (i)
@@ -1452,3 +1463,116 @@ S_msg_report_wait (mach_port_t process, thread_t thread,
   *rpc = 0;
   return 0;
 }
+
+/* fsys */
+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)
+{
+  error (0, 0, "S_fsys_getroot");
+  /* XXX check permissions */
+  *do_retry = FS_RETRY_NORMAL;
+  *retry_name = '\0';
+  *ret = startup;
+  *rettype = MACH_MSG_TYPE_COPY_SEND;
+  return 0;
+}
+
+error_t
+S_fsys_goaway (mach_port_t control, int flags)
+{
+  return EOPNOTSUPP;
+}
+
+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)
+{
+  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;
+}
+
+error_t
+S_fsys_get_children (mach_port_t server,
+                     mach_port_t reply,
+                     mach_msg_type_name_t replyPoly,
+                     char **children,
+                     mach_msg_type_number_t *children_len)
+{
+  return EOPNOTSUPP;
+}
+
+error_t
+S_fsys_get_source (mach_port_t server,
+                   mach_port_t reply,
+                   mach_msg_type_name_t replyPoly,
+                   char *source)
+{
+  return EOPNOTSUPP;
+}
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]