PUPANIC(3PROC) | Process Control Library Functions | PUPANIC(3PROC) |
Pupanic
,
Pupanic_free
— get upanic
information from a core file
Process Control Library (libproc, -lproc)
#include
<libproc.h>
int
Pupanic
(struct ps_prochandle *P,
prupanic_t **prup);
void
Pupanic_free
(prupanic_t
*pru);
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.
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.
The Pupanic
() function will fail if:
See LOCKING in libproc(3LIB).
March 30, 2022 | OmniOS |