core(5) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
CORE(5)                   NetBSD Programmer's Manual                   CORE(5)


NAME
core - memory image file format
SYNOPSIS
#include <sys/param.h>
DESCRIPTION
A small number of signals which cause abnormal termination of a process also cause a record of the process's in-core state to be written to disk for later examination by one of the available debuggers (see signal(7)). This memory image is written to a file named from a per-process template; provided the terminated process had write permission, and provided the abnormality did not cause a system crash. (In this event, the decision to save the core file is arbitrary, see savecore(8).) The file is named from a per-process template, mapped to the sysctl variable proc.<pid>.corename (where <pid> has to be replaced by the pid in decimal format of the process). This template is either an absolute or relative path name, in which format characters can be used, preceeded by the per- cent character (``%''). The following characters are recognised as for- mat and subsitued: n The process's name p The PID of the process (in decimal) t The process's creation date (a la time(3), in decimal) u The login name, as returned by getlogin(2) By default, the per-process template string points to the default core name template, which is mapped to the sysctl variable kern.defcorename. Changing this value on a live system will change the core name template for all processes which didn't have a per-process template set. The de- fault value of the default core name template is %n.core and can be changed at compile-time with the kernel configuration option options DEFCORENAME (see options(4)) The per-process template string is inherited on process creation, but is reset to point to the default core name template on execution of a set-id binary. The maximum size of a core file is limited by setrlimit(2). Files which would be larger than the limit are not created. The core file consists of the u. area, whose size (in pages) is defined by the UPAGES manifest in the <sys/param.h> file. The u. area starts with a user structure as given in <sys/user.h>. The remainder of the core file consists of the data pages followed by the stack pages of the process image. The amount of data space image in the core file is given (in pages) by the variable u_dsize in the u. area. The amount of stack image in the core file is given (in pages) by the variable u_ssize in the u. area. The size of a ``page'' is given by the constant NBPG (also from <sys/param.h>).
SEE ALSO
gdb(1), setrlimit(2), sysctl(3), signal(7), sysctl(8)
HISTORY
A core file format appeared in Version 6 AT&T UNIX. NetBSD 1.5 December 11, 1993 1
Powered by man-cgi (2024-03-20). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.