Subject: core dump filename format
To: None <tech-userlevel@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 09/07/1999 15:12:43
[ Bcc'd to tech-kern, as although this is mostly a userlevel thing,
  some changes affect the kernel ]

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
%p: the pid of the process
%u: name of the user

Idea for other formats are welcome.

The default value would be %s.core, but can be changed at runtime by a sysctl.
Absolute path are allowed, as something like: "/var/core/%u/%n.core"
kern.shortcorename would disappear, as the same thing can be achieved
with kern.corename="core".

As this attribute is really close to process limits, I plan to extend
getrlimit/setrlimit with a new resource type (Otherwise a new syscall would
need to be created for this purpose). They would now take a void * parameter,
which would be a struct rlimit * or char *, depending on the resource type.
In the kernel this attribute would be added to "struct plimit".

Then each shell will be updated to allow users to set this new "limit".

Comments ? I'm planning to start coding on this soon, shouldn't require
much work.

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