Copyright 1989 AT&T Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
gcore [-pgF] [-o filename] [-c content] process-id...
The gcore utility creates a core image of each specified process. By default, the name of the core image file for the process whose process ID is process-id is core.process-id.
The following options are supported: -c content
Produces core image files with the specified content. The content description uses the same tokens as in coreadm(8). The -c option does not apply to cores produced due to the -p or -g flags.
Force. Grabs the target process even if another process has control.
Produces core image files in the global core file repository with the global content as configured by coreadm(8). The command fails if the user does not have permissions to the global core file repository.
Substitutes filename in place of core as the first part of the name of the core image files. filename can contain the same tokens to be expanded as the paths in coreadm(8).
Produces a core image file in the process-specific location with the process-specific content for each process as configured by coreadm(8). The command fails if the user does not have permissions to the per-process core file repository.
The following operand is supported: process-id
process ID
Caution should be exercised when using the -F flag. Imposing two controlling processes on one victim process can lead to chaos. Safety is assured only if the primary controlling process, typically a debugger, has stopped the victim process and the primary controlling process is doing nothing at the moment of application of the proc tool in question.
The following exit values are returned: 0
On success.
On failure, such as non-existent process ID.
core images
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability See below. |
The command syntax is Evolving. The Output Formats are Unstable.
kill (1), setrlimit (2), core (5), proc (5), attributes (7), coreadm (8)
gcore is unaffected by the setrlimit(2) system call using the RLIMIT_CORE value.