1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)core.5 8.3 (Berkeley) 12/11/93 7.\" 8.Dd 9.Dt CORE 5 10.Os BSD 4 11.Sh NAME 12.Nm core 13.Nd memory image file format 14.Sh SYNOPSIS 15.Fd #include <sys/param.h> 16.Sh DESCRIPTION 17A small number of signals which cause abnormal termination of a process 18also cause a record of the process's in-core state to be written 19to disk for later examination by one of the available debuggers. 20(See 21.Xr sigaction 2 . ) 22This memory image is written to a file named 23.Nm programname.core 24in the working directory; 25provided the terminated process had write permission in the directory, 26and provided the abnormality did not cause 27a system crash. 28(In this event, the decision to save the core file is arbitrary, see 29.Xr savecore 8 . ) 30.Pp 31The maximum size of a 32.Nm programname.core 33file is limited by 34.Xr setrlimit 2 . 35Files which would be larger than the limit are not created. 36.Pp 37The 38.Nm programname.core 39file consists of the 40.Fa u . 41area, whose size (in pages) is 42defined by the 43.Dv UPAGES 44manifest in the 45.Aq Pa sys/param.h 46file. The 47.Fa u . 48area starts with a 49.Fa user 50structure as given in 51.Aq Pa sys/user.h . 52The remainder of the 53.Nm programname.core 54file consists of the data pages followed by 55the stack pages of the process image. 56The amount of data space image in the 57.Nm programname.core 58file is given (in pages) by the 59variable 60.Fa u_dsize 61in the 62.Fa u . 63area. 64The amount of stack image in the core file is given (in pages) by the 65variable 66.Fa u_ssize 67in the 68.Ar u . 69area. 70The size of a ``page'' is given by the constant 71.Dv NBPG 72(also from 73.Aq Pa sys/param.h ) . 74.Sh SEE ALSO 75.Xr adb 1 , 76.Xr dbx 1 , 77.Xr gdb 1 , 78.Xr kgdb 1 , 79.Xr sigaction 2 , 80.Xr setrlimit 2 81.Sh HISTORY 82A 83.Nm core 84file format appeared in 85.At v6 . 86