From 02f5c0208985d60fede08c1eafad04e80353b670 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 3 Jun 2016 00:52:06 +0200 Subject: trans/crash: core file name templates Add an option to specify a template used to construct core file names. This way core files can be collected at a predictable central location. * hurd/crash.defs (crash_dump_task): Return EEXIST if the core file has been written elsewhere. * trans/crash.c (corefile_template): New variable. (template_valid): New function. (template_make_file_name): Likewise. (S_crash_dump_task): Use the template to construct a name, open the file, and write the core dump there instead of the handle provided by the caller. (argp_option): New option. (doc): Document the format. (parse_opt): Handle new option (trivfs_append_args): Likewise. --- hurd/crash.defs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hurd') diff --git a/hurd/crash.defs b/hurd/crash.defs index 442957d13..429586179 100644 --- a/hurd/crash.defs +++ b/hurd/crash.defs @@ -25,8 +25,10 @@ subsystem crash 32000; /* Handle a crashing task, whose task control port is TASK. - FILE is a file port open for writing. The caller will link it to "core" - (or whatever name) if the RPC returns success. + FILE is a file port open for writing. The caller will link it to + "core" (or whatever name) if the RPC returns success. If EEXIST is + returned, the core file has been written to a different file, + therefore FILE can be discarded. SIGNO, SIGCODE, and SIGERROR indicate the signal that killed the process. EXC is zero for a software signal; otherwise EXC, CODE, and -- cgit v1.2.3