With DIGITAL UNIX Version 4.0D, you can enable enhanced core file naming, as described in Section 1.4, by following the instructions in this appendix.
When enhanced core file naming is enabled, the system produces core files with names in the following format:
core.
prog-name.
host-name.tag
This file name can be broken down into four parts:
core
The literal string
core
.
Up to sixteen characters taken from the program name as shown by the
ps
command.
The first portion of the system's network host name, or up to 16 characters of the host name, taken from the part of the host name that precedes the first dot.
For example, the fourth core file generated on host
buggy.net.ooze.com
by the program
dropsy
would be:
core.dropsy.buggy.3
This tag is assigned to the core file to make it unique among all the core files generated by a program on a host. The maximum value for this tag, and thus the maximum number of core files for this program and host, is set by a system configuration parameter.
Note that the tag is not a literal version number. The system selects the first available unique tag for the core file. For example, if a program's core files have tags .0, .1, and .3, the system uses tag .2 for the next core file it creates for that program. If the system-configured limit for core file instances is reached, the system will not create any more core files for that program/host combination. By default, the system can create up to 16 versions of a core file.
Note
If you plan to save a number of uniquely named core files, be aware that core files can consume a lot of disk space. Allowing core files to be saved under different names in a file system with minimal free space can potentially fill your disk because the files are not overwritten when new core files are created. If you enable this feature, make sure to remove old core files when you are done examining them.
You can enable enhanced core file naming in one of two ways.
enhanced-core-name
system configuration variable to 1 in the
proc
subsystem, as in the following example:
proc: enhanced-core-name = 1
The system manager can limit the number of unique core file versions
that a program can create on a specific host system by setting the
system configuration variable
enhanced-core-max-versions
to the desired value, as in the following example:
proc: enhanced-core-name = 1 enhanced-core-max-versions = 8
The minimum value is 1, the maximum value is 99,999, and the default is 16.
uswitch
system call with the
USW_CORE
flag set, as in the following example:
#include <signal.h> #include <sys/uswitch.h>
/* * Request enhanced core file naming for * this process then create a core file. */ main() { long uval = uswitch(USC_GET, 0); uval = uswitch(USC_SET, uval | USW_CORE); if (uval < 0) { perror("uswitch"); exit(1); } raise(SIGQUIT); }