Subject: Re: core dump filename format
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-userlevel
Date: 09/08/1999 18:44:49
On Wed, Sep 08, 1999 at 10:54:20AM -0400, der Mouse wrote:
> My first impulse is to suggest %s and %S, but I think avoiding %s
> entirely would be a good idea.  (I'd also be inclined to avoid %d.)
> 
> Perhaps %S0 and %Sa (numeric and alpha forms)?  %k and %K ("k"illing
> signal)?

I'd prefer if we could keep one-letter formats, for simplicity.
Do we really need both the name and the numeric form ?

> >> [...maybe sysctl(3) / __sysctl(2)...] would also sidestep the
> >> question of how to return a string of more or less unlimited length
> > This should be limited to MAXPATHLEN, isn't it ?
> 
> Since fairly few formats will be longer than the text they can
> generate, it's unlikely.  We certainly could decree by fiat that the
> coredump format is limited to MAXPATHLEN.... :-)

That's what I do in the code I started.

> 
> >> through the getrlimit() interface, even as extended.
> > Won't /copyoutstr DTRT ?
> 
> Well, as far as copying it goes, presumably.  I'm just uneasy around
> interfaces that return strings of potentially large size without taking
> a size parameter.  termcap used this for tgetent() and look at the mess
> that resulted when termcap entries got large.  getwd() did this and it
> proved to be enough of a problem that getcwd() was created.

Hum. Maybe a sysctl is better. I've not looked at how difficult this is,
though.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--