PGCORE(3PROC) Process Control Library Functions PGCORE(3PROC)

NAME


Pfgcore, Pgcore - produce a core file of a process

SYNOPSIS


int
Pfgcore(struct ps_prochandle *P, int fd, core_content_t content);

int
Pgcore(struct ps_prochandle *P, const char *fname, core_content_t content);

DESCRIPTION


The Pgcore() and Pfgcore() functions produce core files of the handle
referred to by P. Core files represent a snapshot of a process and may be
manipulated by a wide variety of tools and libraries including
libproc(3LIB), mdb(1), pargs(1), pstack(1), and more. For details on the
core file format, see core(4).

Pfgcore() writes the core to the file represented by the open descriptor
fd. The file descriptor should be open for both read and write. Pgcore()
writes the core to the file path fname.

The content of the core is controlled by the content argument. It's the
inclusive-bitwise-OR of the various content types listed under the
core_content_t heading in the TYPES section in libproc(3LIB). Using
CC_CONTENT_INVALID is illegal and will result in an error.

Neither the Pgcore() or Pfgcore() functions stop the handle P. It is up to
the caller to stop the process; which is recommended for obtaining a
consistent view of the process. See the Pstop(3PROC) function for a means
to stop a handle.

RETURN VALUES


Upon successful completion, the Pfcore() and Pgcore() functions return 0
and write out a core file to specified location. Otherwise, -1 is
returned. The Pfgcore() function will truncate fd and the Pgcore()
function will remove fname.

INTERFACE STABILITY


Uncommitted

MT-LEVEL
See LOCKING in libproc(3LIB).

SEE ALSO


coreadm(1M), libproc(3LIB), Pstop(3PROC), core(4), proc(4)

illumos May 11, 2016 illumos