HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

c
coreadm(2) coreadm(2)
NAME
coreadm - application core file administration
SYNOPSIS
#include <core.h>
int coreadm(int c_version, pid_t c_pid, core_file_settings_t *c_in,
core_file_settings_t *c_out);
DESCRIPTION
coreadm() system call is used to specify the location and pattern for core files produced by abnormally
terminating processes. See core(4). This system call can be used to specify a system wide location for core
file placement and/or a process specific pattern.
The structure, corefile_settings_t
is used to specify a system wide or a per-process core file pat-
tern and also specify the current system wide core file settings.
corefile_settings_t
is defined in
the header
<core.h>.
Member Type Member Name Description
The core file pattern.char c_pattern
Core file settings.uint64_t c_flags
Parameters
c_version is expected to be set to COREADM_VERSION
. It is critical for future backward compatibility
that the
COREADM_VERSION
macro itself be used and not its value.
c_pattern is the core file pattern. A core file name pattern is a normal file system path name with
embedded variables, specified with a leading % character, that are expanded from values in effect when a
core file is generated by the operating system. An expanded pattern length greater than MAXPATHLEN
will be truncated to MAXPATHLEN .
The possible values are:
%p process ID
%xp Process ID in hex
%u effective user-ID
%xu effective user-ID in Hex
%g effective group-ID
%xg effective group-ID in Hex
%c thread’s CPU number when the core file was created
%f executable file name, up to a maximum of MAXCOMMLEN characters
%n system node name (uname -n)
%t time-stamp (in UTC time format)
%% literal %
c_flags is used to control the system wide core file settings. The flag values can be combination of
COREADM_GLBL_ENABLED
Enable/Disable creation of global core files.
COREADM_PROC_ENABLED Enable/Disable creation of per-process core files.
COREADM_GLBL_SETID_ENABLED Enable/Disable creation of global core files for
setuid processes.
COREADM_PROC_SETID_ENABLED Enable/Disable creation of per-process core file for
setuid
processes.
If a flag value is not set, then the option is disabled.
For per-process core file setting, c_flags can either be 0 or COREADM_PROC_ENABLED
. The former dis-
ables core file creation (for that process) and the latter enables it.
c_pid Should be a (valid) pid of a target process or 0. If c_pid is zero, then the settings are applied to
global core file settings. If c_pid is 1, then the settings are applied to init(1M).
c_in If non-NULL, then the values will be used as new core file settings. If this is NULL, then the
c_out parameter is expected to be non-NULL and system call is used to interrogate the current
settings.
74 Hewlett-Packard Company 1 HP-UX 11i Version 3: February 2007