HP-UX Reference (11i v2 07/12) - 1 User Commands A-M (vol 1)
g
gcore(1) gcore(1)
NAME
gcore - get core images of running processes
SYNOPSIS
gcore [-o filename] process-id...
DESCRIPTION
The
gcore command creates a core image of each specified process. By default, the name of the core
image file for process-id is core.process-id. The process information in the core file can be obtained by
using debuggers.
When the
gcore command creates a core image of each specified process, the process is temporarily
stopped. When the creation of the core image is complete, the process continues to execute.
Options
-o filename Creates the core file with name of the file as filename
.process-id. If multiple process-id
values are specified, all the names of the core image files will begin with filename. See the
EXAMPLES section.
Operands
process-id The process ID for which a core image file will be created.
RETURN VALUE
Upon completion
gcore exits with one of the following values:
0 A core file was successfully created.
>0 An error condition was encountered. In this case the creation of a core file is not guaranteed.
The possible error conditions include:
• A nonexistent or incorrect process ID was specified.
• An invalid option was specified.
• The directory of the dumpfile or directory from which gcore was invoked did not have
write permissions.
• The filename.<pid> directory with core.<pid> subdirectory already exists.
• The current working directory of the process was not accessible.
• The file system is full.
EXAMPLES
Example 1
Dump the core image of process 1030 into the file core.1030 .
gcore 1030
Example 2
Dump the core image of process 1030 into the file test.1030 .
gcore -o test 1030
Example 3
Dump the core image of processes 1030, 1031, 1032, and 1033 into the files core.1030 , core.1031 ,
core.1032, and core.1033 .
gcore 1030 1031 1032 1033
Example 4
Dump the core image of processes 1030, 1031, 1032, and 1033 into the files test.1030 , test.1031 ,
test.1032, and test.1033 .
gcore -o test 1030 1031 1032 1033
Example 5
Dump the core image of process 1030 into the file core.1030 in existing directory
/tmp/testgcore.1030.
382 Hewlett-Packard Company − 1 − HP-UX 11i Version 2: December 2007 Update