summaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
Diffstat (limited to 'trans')
-rw-r--r--trans/Makefile8
-rw-r--r--trans/crash.c24
2 files changed, 16 insertions, 16 deletions
diff --git a/trans/Makefile b/trans/Makefile
index 74d0cc78..ed5e36f4 100644
--- a/trans/Makefile
+++ b/trans/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (C) 1994,95,96,97,99,2000,2001 Free Software Foundation, Inc.
+# Copyright (C) 1994,95,96,97,99,2000,01,02 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -24,15 +24,17 @@ SRCS = ifsock.c symlink.c magic.c null.c fifo.c new-fifo.c fwd.c \
crash.c firmlink.c password.c hello.c hello-mt.c streamio.c
OBJS = $(SRCS:.c=.o) fsysServer.o ifsockServer.o passwordServer.o \
crashServer.o crash_replyUser.o msgServer.o \
- device_replyServer.o
+ device_replyServer.o elfcore.o
HURDLIBS = threads ports trivfs fshelp pipe ihash shouldbeinlibc
password-LDLIBS = $(LIBCRYPT)
include ../Makeconf
+vpath elfcore.c $(top_srcdir)/exec
+
symlink: fsysServer.o
ifsock: ifsockServer.o
-crash: crashServer.o crash_replyUser.o msgServer.o
+crash: crashServer.o crash_replyUser.o msgServer.o elfcore.o
password: passwordServer.o
streamio: device_replyServer.o
diff --git a/trans/crash.c b/trans/crash.c
index 827306b2..c31cd2bf 100644
--- a/trans/crash.c
+++ b/trans/crash.c
@@ -1,5 +1,5 @@
/* GNU Hurd standard crash dump server.
- Copyright (C) 1995,96,97,99,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,99,2000,01,02 Free Software Foundation, Inc.
Written by Roland McGrath.
This file is part of the GNU Hurd.
@@ -69,9 +69,10 @@ enum crash_action
static enum crash_action crash_how, crash_orphans_how;
-error_t dump_core (task_t task, file_t core_file,
- int signo, long int sigcode, int sigerror);
-
+/* This is defined in ../exec/elfcore.c, or we could have
+ different implementations for other formats. */
+extern error_t dump_core (task_t task, file_t file, off_t corelimit,
+ int signo, long int sigcode, int sigerror);
/* This data structure describes a crashing task which we have suspended.
This is attached to a receive right we have set as the process's message
@@ -90,6 +91,7 @@ struct crasher
task_t task;
file_t core_file;
+ off_t core_limit;
int signo, sigcode, sigerror;
mach_port_t original_msgport; /* Restore on resume. */
@@ -214,6 +216,7 @@ S_crash_dump_task (mach_port_t port,
c->task = task;
c->core_file = core_file;
+ c->core_limit = (off_t) -1; /* XXX should core limit in RPC */
c->signo = signo;
c->sigcode = sigcode;
c->sigerror = sigerror;
@@ -230,7 +233,9 @@ S_crash_dump_task (mach_port_t port,
err = task_suspend (task);
if (!err)
{
- err = dump_core (task, core_file, signo, sigcode, sigerror);
+ err = dump_core (task, core_file,
+ (off_t) -1, /* XXX should get core limit in RPC */
+ signo, sigcode, sigerror);
task_resume (task);
}
break;
@@ -370,13 +375,6 @@ S_msg_sig_post_untraced (mach_port_t port,
return err;
}
-error_t
-dump_core (task_t task, file_t core_file,
- int signo, long int sigcode, int sigerror)
-{
- return ENOSYS; /* XXX */
-}
-
/* This gets called when the receive right for a crasher message port dies. */
void
@@ -395,7 +393,7 @@ dead_crasher (void *ptr)
{
/* C->proc was cleared in S_msg_sig_post as a marker that
this crasher should get a core dump when we clean him up. */
- error_t err = dump_core (c->task, c->core_file,
+ error_t err = dump_core (c->task, c->core_file, c->core_limit,
c->signo, c->sigcode, c->sigerror);
/* Now reply to the crasher's original RPC which started this whole
party. He should now report his own death (with core dump iff ERR