UPANIC(2) System Calls UPANIC(2)
NAME
upanic - user process panic
SYNOPSIS
#include <upanic.h> void noreturn upanic(
const char *msg,
size_t len);
DESCRIPTION
The
upanic() system call terminates the calling process and generates a
core file in the process, subject to the current core file settings as
described in
core(5) and controlled by
coreadm(8).
Unlike
abort(3C), signals are not generated, which avoids two related
challenges:
1. A signal handler attempting to catch a SIGABRT.
2. Needing to make multiple system calls and potentially unmasking the
signal.
The
upanic() system call allows an optional message to be transmitted that
will be put in a NT_UPANIC elf note in the resulting core file. If a
message is not desired, then one should pass NULL for
msg. In general, it
is expected that
msg is a character string with a human-readable message;
however, it may include binary data. The system will copy
len bytes
regardless of whether the string has a NUL character to terminate it or
not. If
msg points to an invalid value or
len is a size that is larger
than the system's internal maximum size, then the process will still
terminate; however, this will be noted in the NT_UPANIC elf note.
The
upanic() system call is illumos-specific and not portable to other
systems. For portable applications, instead use
abort(3C).
RETURN VALUES
The
upanic() system call does not return. It always terminates the
process.
INTERFACE STABILITY
CommittedMT-LEVEL Async-Signal-SafeSEE ALSO
elfdump(1),
mdb(1),
upanic.h(3HEAD),
core(5),
coreadm(8)OmniOS October 31, 2020 OmniOS