PUPANIC(3PROC) Process Control Library Functions PUPANIC(3PROC)
NAME
Pupanic,
Pupanic_free - get upanic information from a core file
LIBRARY
Process Control Library (libproc, -lproc)
SYNOPSIS
#include <libproc.h> int Pupanic(
struct ps_prochandle *P,
prupanic_t **prup);
void Pupanic_free(
prupanic_t *pru);
DESCRIPTION
The
Pupanic() function copies the contents of the NT_UPANIC elf note
from the process handle
P that corresponds to a core file into
prup.
The library will allocate the memory needed for a
prupanic_t and it is
the caller's responsibility to release it by calling the
Pupanic_free()
function with the returned data when they are done with the data.
The allocated data stored in
prup has a lifetime independent of the
underlying process handle
P. That is, it is safe to continue using it
whether the process handle is still valid or has been released with
Pfree(3PROC).
If the process handle doesn't correspond to a core file or this note is
not present in the core file, then the
Pupanic() function will fail.
RETURN VALUES
Upon successful completion, the
Pupanic() function returns
0 and stores
the allocated
prupanic_t structure in
prup. Otherwise
-1 is returned
and
errno is set to indicate the error.
ERRORS
The
Pupanic() function will fail if:
ENODATA The process handle
P does not correspond to a core
file.
ENOENT The core file does not have a NT_UPANIC elf note.
EAGAIN, ENOMEM An underlying memory allocation failed.
INTERFACE STABILITY
UncommittedMT-LEVEL See
LOCKING in
libproc(3LIB).
SEE ALSO
upanic(2),
libproc(3LIB),
core(5)illumos March 30, 2022 illumos