diff options
Diffstat (limited to 'usr/src/man/man3proc')
-rw-r--r-- | usr/src/man/man3proc/Makefile | 4 | ||||
-rw-r--r-- | usr/src/man/man3proc/Pupanic.3proc | 103 |
2 files changed, 107 insertions, 0 deletions
diff --git a/usr/src/man/man3proc/Makefile b/usr/src/man/man3proc/Makefile index 422bc9a517..a0963ce22e 100644 --- a/usr/src/man/man3proc/Makefile +++ b/usr/src/man/man3proc/Makefile @@ -161,6 +161,7 @@ MANFILES= \ Psync.3proc \ Psysentry.3proc \ Puname.3proc \ + Pupanic.3proc \ Pupdate_maps.3proc \ Pupdate_syms.3proc \ Pwrite.3proc \ @@ -265,6 +266,7 @@ MANLINKS= \ Psymbol_iter_by_lmid.3proc \ Psymbol_iter_by_name.3proc \ Psysexit.3proc \ + Pupanic_free.3proc \ Punsetflags.3proc \ Pwait.3proc \ Pxcreate.3proc \ @@ -383,6 +385,8 @@ Lclearsig.3proc := LINKSRC = Pclearsig.3proc Lsetrun.3proc := LINKSRC = Psetrun.3proc +Pupanic_free.3proc := LINKSRC = Pupanic.3proc + Pzonepath.3proc := LINKSRC = Pzonename.3proc Pzoneroot.3proc := LINKSRC = Pzonename.3proc diff --git a/usr/src/man/man3proc/Pupanic.3proc b/usr/src/man/man3proc/Pupanic.3proc new file mode 100644 index 0000000000..975ca08eec --- /dev/null +++ b/usr/src/man/man3proc/Pupanic.3proc @@ -0,0 +1,103 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2020 Oxide Comptuer Company +.\" +.Dd October 31, 2020 +.Dt PUPANIC 3PROC +.Os +.Sh NAME +.Nm Pupanic , +.Nm Pupanic_free +.Nd get upanic information from a core file +.Sh LIBRARY +.Lb libproc +.Sh SYNOPSIS +.In libproc.h +.Ft int +.Fo Pupanic +.Fa "struct ps_prochandle *P" +.Fa "prupanic_t **prup" +.Fc +.Ft void +.Fo Pupanic_free +.Fa "prupanic_t *pru" +.Fc +.Sh DESCRIPTION +The +.Fn Pupanic +function copies the contents of the +.Dv NT_UPANIC +elf note from the process handle +.Fa P +that corresponds to a core file into +.Fa prup . +.Pp +The library will allocate the memory needed for a +.Ft prupanic_t +and it is the caller's responsibility to release it by calling the +.Fn Pupanic_free +function with the returned data when they are done with the data. +.Pp +The allocated data stored in +.Fa prup +has a lifetime independent of the underlying process handle +.Fa P . +That is, it is safe to continue using it whether the process handle is +still valid or has been released with +.Xr Pfree 3PROC . +.Pp +If the process handle doesn't correspond to a core file or this note is +not present in the core file, then the +.Fn Pupanic +function will fail. +.Sh RETURN VALUES +Upon successful completion, the +.Fn Pupanic +function returns +.Sy 0 +and stores the allocated +.Ft prupanic_t +structure in +.Fa prup . +Otherwise +.Sy -1 +is returned +and +.Vt errno +is set to indicate the error. +.Sh ERRORS +The +.Fn Pupanic +function will fail if: +.Bl -tag -width Er +.It Er ENODATA +The process handle +.Fa P +does not correspond to a core file. +.It Er ENOENT +The core file does not have a +.Dv NT_UPANIC +elf note. +.It Er EAGAIN, Er ENOMEM +An underlying memory allocation failed. +.El +.Sh INTERFACE STABILITY +.Sy Uncommitted +.Sh MT-LEVEL +See +.Sy LOCKING +in +.Xr libproc 3LIB . +.Sh SEE ALSO +.Xr upanic 3C , +.Xr libproc 3LIB , +.Xr core 4 |