Subject: Re: core dump filename format
To: Jaromir Dolecek <>
From: Manuel Bouyer <>
List: tech-userlevel
Date: 09/07/1999 17:22:02
On Tue, Sep 07, 1999 at 04:28:32PM +0300, Jaromir Dolecek wrote:
> Manuel Bouyer wrote:
> > Hi,
> > Following Bill Sommerfeld's idea of "core dump filename format",
> > here is a more formal proposal:
> > 
> > I propose to add a per-process inherited attribute, which would define
> > the name of the core file.
> > I can see 3 usefull formats:
> > %n: name (argv[0]) of the process
> You mean process's p_comm value, right ? I guess it's not
> worth the efford to find the argv[0].

Well, maybe. I didn't look closely at this yet :)

> > %p: the pid of the process
> > %u: name of the user
> Is the name available to the kernel somehow ?

struct proc has a pointer to struct pgrp which has one to struct session which
has s_login[]. My intent was to use that ...

> > Idea for other formats are welcome.
> I'd probably prefer something vaguely related to printf() format's,
> i.e. %s for the name of process, %d for pid. Or avoid those funny
> %foo altogether and use plain strings 'progname', 'pid',
> 'username'/'uid'. Consider how much more readable is
> 'progname-pid.core' than '%n-%p.core'.

Hum this can lead to confusions. Imagine you want to name a directory
'pid'. I prefer %x formats, its more obvious that this will be remplaced.

Ok for %s and %d instead of %n and %p.

Manuel Bouyer, LIP6, Universite Paris VI.