aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1998-07-21 18:16:16 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1998-07-21 18:16:16 +0000
commitaa81f3a9d85a26b38316d07ae140c02adf2cb066 (patch)
tree8f831a27af61c802b5312dd656c33614c6fcee67 /share
parent991b3bc3b3f565f825d04516fed1f755787b2e2c (diff)
Notes
Diffstat (limited to 'share')
-rw-r--r--share/man/man5/core.546
1 files changed, 33 insertions, 13 deletions
diff --git a/share/man/man5/core.5 b/share/man/man5/core.5
index c2e60e45ad73..c3e07e17f157 100644
--- a/share/man/man5/core.5
+++ b/share/man/man5/core.5
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)core.5 8.3 (Berkeley) 12/11/93
-.\" $Id: core.5,v 1.5 1997/02/22 13:25:57 peter Exp $
+.\" $Id: core.5,v 1.6 1998/05/11 03:41:51 steve Exp $
.\"
.Dd December 11, 1993
.Dt CORE 5
@@ -46,7 +46,7 @@ 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
.Xr sigaction 2 . )
-This memory image is written to a file named
+This memory image is written to a file named by default
.Nm programname.core
in the working directory;
provided the terminated process had write permission in the directory,
@@ -55,15 +55,28 @@ a system crash.
(In this event, the decision to save the core file is arbitrary, see
.Xr savecore 8 . )
.Pp
-The maximum size of a
-.Nm programname.core
-file is limited by
+The maximum size of a core file is limited by
.Xr setrlimit 2 .
Files which would be larger than the limit are not created.
.Pp
-The
-.Nm programname.core
-file consists of the
+The name of the file is controlled via the
+.Xr sysctl 8
+variable
+.Va kern.corefile .
+The contents of this variable describes a filename to store
+the core image to. This filename can be absolute, or relative (which
+will resolve to the current working directory of the program
+generating it). Any sequence of
+.Em \&%N
+in this filename template will be replaced by the process name,
+.Em \&%P
+by the processes PID, and
+.Em \&%U
+by the UID. The name defaults to
+.Em \&%N.core ,
+yielding the traditional FreeBSD behaviour.
+.Pp
+The core file consists of the
.Fa u .
area, whose size (in pages) is
defined by the
@@ -76,12 +89,10 @@ area starts with a
.Fa user
structure as given in
.Aq Pa sys/user.h .
-The remainder of the
-.Nm programname.core
+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
-.Nm programname.core
+The amount of data space image in the core
file is given (in pages) by the
variable
.Fa u_dsize
@@ -98,11 +109,20 @@ The size of a ``page'' is given by the constant
.Dv PAGE_SIZE
(also from
.Aq Pa sys/param.h ) .
+.Sh EXAMPLES
+In order to store all core images in per-user private areas under
+.Pa /var/coredumps ,
+the following
+.Xr sysctl 8
+command can be used:
+.Pp
+.Dl sysctl -w kern.corefile="/var/coredumps/\&%U/\&%N.core"
.Sh SEE ALSO
.Xr gdb 1 ,
.Xr kgdb 1 ,
.Xr setrlimit 2 ,
-.Xr sigaction 2
+.Xr sigaction 2 ,
+.Xr sysctl 8
.Sh HISTORY
A
.Nm core