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

Pfgcore, Pgcoreproduce a core file of a process

Process Control Library (libproc, -lproc)

#include <libproc.h>

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);

The () 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(5).

() 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 heading in the section in libproc(3LIB). Using CC_CONTENT_INVALID is illegal and will result in an error.

Neither the () 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.

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

See in libproc(3LIB).

libproc(3LIB), Pstop(3PROC), core(5), proc(5), coreadm(8)

November 27, 2023 OmniOS