BSD 4_4_Lite1 release
[unix-history] / usr / src / share / man / man5 / core.5
CommitLineData
517c4acb
KB
1.\" Copyright (c) 1980, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
a31f4e53 3.\"
ad787160
C
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
a31f4e53 19.\"
ad787160
C
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
d4b7a6e5 31.\"
ed554bc5 32.\" @(#)core.5 8.3 (Berkeley) 12/11/93
ad787160 33.\"
ed554bc5 34.Dd December 11, 1993
d4b7a6e5
CL
35.Dt CORE 5
36.Os BSD 4
37.Sh NAME
38.Nm core
39.Nd memory image file format
40.Sh SYNOPSIS
41.Fd #include <sys/param.h>
42.Sh DESCRIPTION
43A small number of signals which cause abnormal termination of a process
44also cause a record of the process's in-core state to be written
653ba8b6 45to disk for later examination by one of the available debuggers.
d4b7a6e5
CL
46(See
47.Xr sigaction 2 . )
48This memory image is written to a file named
6a5b6cb6 49.Nm programname.core
d4b7a6e5
CL
50in the working directory;
51provided the terminated process had write permission in the directory,
653ba8b6 52and provided the abnormality did not cause
d4b7a6e5
CL
53a system crash.
54(In this event, the decision to save the core file is arbitrary, see
55.Xr savecore 8 . )
56.Pp
a31f4e53 57The maximum size of a
6a5b6cb6 58.Nm programname.core
a31f4e53 59file is limited by
d4b7a6e5 60.Xr setrlimit 2 .
a31f4e53 61Files which would be larger than the limit are not created.
d4b7a6e5
CL
62.Pp
63The
6a5b6cb6 64.Nm programname.core
d4b7a6e5
CL
65file consists of the
66.Fa u .
aa6cecc5 67area, whose size (in pages) is
d4b7a6e5
CL
68defined by the
69.Dv UPAGES
70manifest in the
71.Aq Pa sys/param.h
aa6cecc5 72file. The
d4b7a6e5 73.Fa u .
aa6cecc5 74area starts with a
d4b7a6e5 75.Fa user
aa6cecc5 76structure as given in
d4b7a6e5
CL
77.Aq Pa sys/user.h .
78The remainder of the
6a5b6cb6 79.Nm programname.core
d4b7a6e5 80file consists of the data pages followed by
a31f4e53 81the stack pages of the process image.
d4b7a6e5 82The amount of data space image in the
6a5b6cb6 83.Nm programname.core
d4b7a6e5 84file is given (in pages) by the
aa6cecc5 85variable
d4b7a6e5 86.Fa u_dsize
aa6cecc5 87in the
d4b7a6e5 88.Fa u .
aa6cecc5
KM
89area.
90The amount of stack image in the core file is given (in pages) by the
91variable
d4b7a6e5 92.Fa u_ssize
aa6cecc5 93in the
d4b7a6e5 94.Ar u .
aa6cecc5 95area.
d4b7a6e5
CL
96The size of a ``page'' is given by the constant
97.Dv NBPG
15cdbbef 98(also from
d4b7a6e5
CL
99.Aq Pa sys/param.h ) .
100.Sh SEE ALSO
101.Xr adb 1 ,
102.Xr dbx 1 ,
103.Xr gdb 1 ,
104.Xr kgdb 1 ,
105.Xr sigaction 2 ,
106.Xr setrlimit 2
107.Sh HISTORY
108A
6a5b6cb6 109.Nm core
d4b7a6e5
CL
110file format appeared in
111.At v6 .