summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-01-30 23:45:32 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-01-30 23:45:32 +0000
commit0bb14d0b8d6a7b36cf0bf445dbfebfe76ed6a592 (patch)
tree64f8ef543d938e63c1ccb9ccf381223bf35cac0b
parent1bec8dc0fea138a7a6a1e340916d2bc66e9cdfb2 (diff)
daemons/
2001-01-17 Neal H Walfield <neal@cs.uml.edu> * console-run.c (open_console): Conform to new fshelp_start_translator semantics. init/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * init.c (open_console): Conform to new fshelp_start_translator semantics. libfshelp/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * fshelp.h: Add two new parameters to fshelp_open_fn_t: a port to the new task and a cookie. Add a new parameter, cookie, to fshelp_start_translator and fshelp_start_translator_long that will be passed to fshelp_open_fn_t. * fetch-root.c (fshelp_fetch_root): Conform to new fshelp_start_translator_long semantics. * start-translator-long.c (service_fsys_startup): Likewise. (fshelp_start_translator_long): Likewise. * start-translator.c (fshelp_start_translator): Likewise. libtreefs/ Conform to new fshelp_start_translator semantics. trans/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * pump.c (start_pfinet): Conform to new fshelp_start_translator semantics. utils/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * mount.c (do_mount): Conform to new fshelp_start_translator semantics. * settrans.c (main): Conform to new fshelp_start_translator semantics therby allowing us to print the pid of the an active translator.
-rw-r--r--TODO1
-rw-r--r--daemons/ChangeLog5
-rw-r--r--daemons/console-run.c9
-rw-r--r--init/ChangeLog5
-rw-r--r--init/init.c7
-rw-r--r--libfshelp/ChangeLog14
-rw-r--r--libfshelp/fetch-root.c5
-rw-r--r--libfshelp/fshelp.h7
-rw-r--r--libfshelp/start-translator-long.c16
-rw-r--r--libfshelp/start-translator.c6
-rw-r--r--libtreefs/trans-start.c2
-rw-r--r--trans/ChangeLog7
-rw-r--r--trans/pump.c5
-rw-r--r--utils/ChangeLog9
-rw-r--r--utils/mount.c5
-rw-r--r--utils/settrans.c11
16 files changed, 81 insertions, 33 deletions
diff --git a/TODO b/TODO
index cb9d4b02..9d60efa6 100644
--- a/TODO
+++ b/TODO
@@ -263,7 +263,6 @@ See `tasks', the exported task list.
** settrans:
*** needs an option to make the active go away without using goaway. !
-*** -P should print the pid of the translator before pausing !
** ps:
*** ps should timeout quickly (one second?) on non-responsive message ports. !
diff --git a/daemons/ChangeLog b/daemons/ChangeLog
index f93ca603..61e3f878 100644
--- a/daemons/ChangeLog
+++ b/daemons/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-17 Neal H Walfield <neal@cs.uml.edu>
+
+ * console-run.c (open_console): Conform to new
+ fshelp_start_translator semantics.
+
1999-09-23 Mark Kettenis <kettenis@gnu.org>
* getty.c (main): Report an error if login_tty failed.
diff --git a/daemons/console-run.c b/daemons/console-run.c
index ccfd3874..0fc19bb4 100644
--- a/daemons/console-run.c
+++ b/daemons/console-run.c
@@ -1,5 +1,5 @@
/* Run a program on the console, trying hard to get the console open.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -112,7 +112,8 @@ open_console (char **namep)
error_t open_node (int flags,
mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
term = file_name_lookup (termname, flags | O_CREAT|O_NOTRANS, 0666);
if (term == MACH_PORT_NULL)
@@ -141,8 +142,8 @@ open_console (char **namep)
/* The callback to start_translator opens TERM as a side effect. */
errno =
- fshelp_start_translator (open_node, terminal, terminal, argz_len,
- 3000, &control);
+ fshelp_start_translator (open_node, NULL, terminal, terminal,
+ argz_len, 3000, &control);
if (errno)
{
error (0, errno, "%s", terminal);
diff --git a/init/ChangeLog b/init/ChangeLog
index 1d09e488..dfef84ae 100644
--- a/init/ChangeLog
+++ b/init/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-17 Neal H Walfield <neal@cs.uml.edu>
+
+ * init.c (open_console): Conform to new fshelp_start_translator
+ semantics.
+
2000-12-21 Marcus Brinkmann <marcus@gnu.org>
* init.c (process_rc_script): If malloc fails, return ENOMEM.
diff --git a/init/init.c b/init/init.c
index 986ba1e4..a9cbafc0 100644
--- a/init/init.c
+++ b/init/init.c
@@ -800,7 +800,8 @@ open_console ()
error_t open_node (int flags,
mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
term = file_name_lookup (termname, flags | O_CREAT|O_NOTRANS, 0666);
if (term == MACH_PORT_NULL)
@@ -837,8 +838,8 @@ open_console ()
/* The callback to start_translator opens TERM as a side effect. */
errno =
- fshelp_start_translator (open_node, terminal, terminal, argz_len, 3000,
- &control);
+ fshelp_start_translator (open_node, NULL, terminal, terminal,
+ argz_len, 3000, &control);
if (errno)
{
error (0, errno, "%s", terminal);
diff --git a/libfshelp/ChangeLog b/libfshelp/ChangeLog
index 15d96d53..15cbf690 100644
--- a/libfshelp/ChangeLog
+++ b/libfshelp/ChangeLog
@@ -1,3 +1,17 @@
+2001-01-17 Neal H Walfield <neal@cs.uml.edu>
+
+ * fshelp.h: Add two new parameters to fshelp_open_fn_t:
+ a port to the new task and a cookie.
+ Add a new parameter, cookie, to fshelp_start_translator and
+ fshelp_start_translator_long that will be passed to
+ fshelp_open_fn_t.
+
+ * fetch-root.c (fshelp_fetch_root): Conform to new
+ fshelp_start_translator_long semantics.
+ * start-translator-long.c (service_fsys_startup): Likewise.
+ (fshelp_start_translator_long): Likewise.
+ * start-translator.c (fshelp_start_translator): Likewise.
+
2000-03-20 Roland McGrath <roland@baalperazim.frob.com>
* delegate.c (fshelp_delegate_translation): Add const to arg type.
diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c
index 0f255bff..3ce6293c 100644
--- a/libfshelp/fetch-root.c
+++ b/libfshelp/fetch-root.c
@@ -84,7 +84,8 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
return ret;
}
error_t fetch_underlying (int flags, mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
return
(*callback2) (box->cookie, cookie, flags,
@@ -130,7 +131,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
fds[STDERR_FILENO] = reauth (getdport (STDERR_FILENO));
- err = fshelp_start_translator_long (fetch_underlying,
+ err = fshelp_start_translator_long (fetch_underlying, NULL,
argz, argz, argz_len,
fds, MACH_MSG_TYPE_COPY_SEND,
STDERR_FILENO + 1,
diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h
index 86cafdb1..81e1fadb 100644
--- a/libfshelp/fshelp.h
+++ b/libfshelp/fshelp.h
@@ -42,7 +42,8 @@
returns the node port. */
typedef error_t (*fshelp_open_fn_t) (int flags,
file_t *node,
- mach_msg_type_name_t *node_type);
+ mach_msg_type_name_t *node_type,
+ task_t, void *cookie);
/* Start a passive translator NAME with arguments ARGZ (length
ARGZ_LEN). Initialize the initports to PORTS (length PORTS_LEN),
@@ -54,7 +55,7 @@ typedef error_t (*fshelp_open_fn_t) (int flags,
task's owner to OWNER_UID (or, if OWNER_UID is -1, then clear the
new task's owner. */
error_t
-fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn,
+fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn, void *cookie,
char *name, char *argz, int argz_len,
mach_port_t *fds,
mach_msg_type_name_t fds_type, int fds_len,
@@ -69,7 +70,7 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn,
are copied from our own state, fd[2] is copied from our own stderr,
and the other fds are cleared. */
error_t
-fshelp_start_translator (fshelp_open_fn_t underlying_open_fn,
+fshelp_start_translator (fshelp_open_fn_t underlying_open_fn, void *cookie,
char *name, char *argz, int argz_len,
int timeout, fsys_t *control);
diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c
index 15fb63cb..3647d567 100644
--- a/libfshelp/start-translator-long.c
+++ b/libfshelp/start-translator-long.c
@@ -98,9 +98,9 @@ static const mach_msg_type_t realnodeType =
translator died, and EDIED will be returned. If an error occurs, the
error code is returned, otherwise 0. */
static error_t
-service_fsys_startup (fshelp_open_fn_t underlying_open_fn,
- mach_port_t port, long timeout,
- fsys_t *control)
+service_fsys_startup (fshelp_open_fn_t underlying_open_fn, void *cookie,
+ mach_port_t port, long timeout, fsys_t *control,
+ task_t task)
{
error_t err;
union
@@ -146,7 +146,8 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn,
reply.RetCode =
(*underlying_open_fn) (request.startup.flags,
- &reply.realnode, &realnode_type);
+ &reply.realnode, &realnode_type, task,
+ cookie);
reply.realnodeType = realnodeType;
reply.realnodeType.msgt_name = realnode_type;
@@ -176,8 +177,8 @@ service_fsys_startup (fshelp_open_fn_t underlying_open_fn,
error_t
fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn,
- char *name, char *argz, int argz_len,
- mach_port_t *fds,
+ void *cookie, char *name, char *argz,
+ int argz_len, mach_port_t *fds,
mach_msg_type_name_t fds_type, int fds_len,
mach_port_t *ports,
mach_msg_type_name_t ports_type, int ports_len,
@@ -276,7 +277,8 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn,
/* Ok, cool, we've got a running(?) program, now rendezvous with it if
possible using the startup protocol on the bootstrap port... */
- err = service_fsys_startup(underlying_open_fn, bootstrap, timeout, control);
+ err = service_fsys_startup(underlying_open_fn, cookie, bootstrap,
+ timeout, control, task);
lose:
if (!ports_moved)
diff --git a/libfshelp/start-translator.c b/libfshelp/start-translator.c
index 5996ac74..ba5418ec 100644
--- a/libfshelp/start-translator.c
+++ b/libfshelp/start-translator.c
@@ -25,8 +25,8 @@
error_t
fshelp_start_translator (fshelp_open_fn_t underlying_open_fn,
- char *name, char *argz, int argz_len,
- int timeout, fsys_t *control)
+ void *cookie, char *name, char *argz,
+ int argz_len, int timeout, fsys_t *control)
{
mach_port_t ports[INIT_PORT_MAX];
mach_port_t fds[STDERR_FILENO + 1];
@@ -45,7 +45,7 @@ fshelp_start_translator (fshelp_open_fn_t underlying_open_fn,
ports[INIT_PORT_AUTH] = getauth ();
fds[STDERR_FILENO] = getdport (STDERR_FILENO);
- err = fshelp_start_translator_long (underlying_open_fn,
+ err = fshelp_start_translator_long (underlying_open_fn, cookie,
name, argz, argz_len,
fds, MACH_MSG_TYPE_COPY_SEND,
STDERR_FILENO + 1,
diff --git a/libtreefs/trans-start.c b/libtreefs/trans-start.c
index 15d7531a..2196a8dc 100644
--- a/libtreefs/trans-start.c
+++ b/libtreefs/trans-start.c
@@ -57,7 +57,7 @@ _treefs_node_start_translator (struct treefs_node *node,
/* XXX this should use fshelp_start_translator_long. */
err =
- fshelp_start_translator (&node->active_trans, trans, trans_len,
+ fshelp_start_translator (&node->active_trans, NULL, trans, trans_len,
parent_port, node_port, uid, gid);
treefs_node_auth_unref (node, auth);
diff --git a/trans/ChangeLog b/trans/ChangeLog
index 80eef65e..7108b6c2 100644
--- a/trans/ChangeLog
+++ b/trans/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-17 Neal H Walfield <neal@cs.uml.edu>
+
+ * pump.c (start_pfinet): Conform to new fshelp_start_translator
+ semantics.
+
2001-01-20 Roland McGrath <roland@frob.com>
* streamio.c (options): Add aliases --rdonly, --ro for -r.
@@ -24,7 +29,7 @@
(OBJS): Add missing object files to list (crashServer.o
crash_replyUser.o msgServer.o device_replyServer.o).
- * storeio.c: New file by OKUJI Yoshinori.
+ * streamio.c: New file by OKUJI Yoshinori.
2000-07-26 Mark Kettenis <kettenis@gnu.org>
diff --git a/trans/pump.c b/trans/pump.c
index 562ce1b1..f9cf5586 100644
--- a/trans/pump.c
+++ b/trans/pump.c
@@ -235,7 +235,8 @@ start_pfinet (char *argz, int argz_len)
{
error_t open_function (int flags,
mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
int err;
@@ -248,7 +249,7 @@ start_pfinet (char *argz, int argz_len)
return 0;
}
- err = fshelp_start_translator (open_function,
+ err = fshelp_start_translator (open_function, NULL,
_HURD_PFINET, argz, argz_len,
60 * 1000, &control);
if (err)
diff --git a/utils/ChangeLog b/utils/ChangeLog
index 5a56b1c9..560391ca 100644
--- a/utils/ChangeLog
+++ b/utils/ChangeLog
@@ -1,3 +1,12 @@
+2001-01-17 Neal H Walfield <neal@cs.uml.edu>
+
+ * mount.c (do_mount): Conform to new fshelp_start_translator
+ semantics.
+
+ * settrans.c (main): Conform to new fshelp_start_translator
+ semantics therby allowing us to print the pid of the an
+ active translator.
+
2001-01-08 Marcus Brinkmann <marcus@gnu.org>
* storeread.c (main): Change type of addr to store_offset_t,
diff --git a/utils/mount.c b/utils/mount.c
index 75610bc6..ea8b419b 100644
--- a/utils/mount.c
+++ b/utils/mount.c
@@ -284,7 +284,8 @@ do_mount (struct fs *fs, int remount)
/* The callback to start_translator opens NODE as a side effect. */
error_t open_node (int flags,
mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
node = file_name_lookup (fs->mntent.mnt_dir,
flags | O_NOTRANS, 0666);
@@ -331,7 +332,7 @@ do_mount (struct fs *fs, int remount)
/* Now we have a translator command line argz in FSOPTS. */
explain ("settrans -a");
- err = fshelp_start_translator (open_node, fsopts,
+ err = fshelp_start_translator (open_node, NULL, fsopts,
fsopts, fsopts_len, timeout,
&active_control);
/* If ERR is due to a problem opening the translated node, we print
diff --git a/utils/settrans.c b/utils/settrans.c
index 408849a3..3145b49c 100644
--- a/utils/settrans.c
+++ b/utils/settrans.c
@@ -29,6 +29,7 @@
#include <error.h>
#include <argz.h>
#include <hurd/fshelp.h>
+#include <hurd/process.h>
#include <version.h>
const char *argp_program_version = STANDARD_HURD_VERSION (settrans);
@@ -170,11 +171,13 @@ main(int argc, char *argv[])
/* The callback to start_translator opens NODE as a side effect. */
error_t open_node (int flags,
mach_port_t *underlying,
- mach_msg_type_name_t *underlying_type)
+ mach_msg_type_name_t *underlying_type,
+ task_t task, void *cookie)
{
if (pause)
{
- fprintf (stderr, "Pausing...");
+ fprintf (stderr, "Translator pid: %d\nPausing...",
+ task2pid (task));
getchar ();
}
@@ -190,8 +193,8 @@ main(int argc, char *argv[])
return 0;
}
- err = fshelp_start_translator (open_node, argz, argz, argz_len, timeout,
- &active_control);
+ err = fshelp_start_translator (open_node, NULL, argz, argz, argz_len,
+ timeout, &active_control);
if (err)
/* If ERR is due to a problem opening the translated node, we print
that name, otherwise, the name of the translator. */