summaryrefslogtreecommitdiff
path: root/usr/src/man/man2
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-11-17 14:48:44 -0500
committerDan McDonald <danmcd@joyent.com>2020-11-17 14:48:44 -0500
commit2d6415143e9c1044d04ebf846f72f232883413cb (patch)
tree555fae9f2f89b0c9a4d8c4bbd66b02b70ded9fc7 /usr/src/man/man2
parent5a1b3228538dfeb09e05cc2bdfad707ee4d698d7 (diff)
parent5a0af8165ce9590e7a18f1ef4f9badc4dd72c6e6 (diff)
downloadillumos-joyent-release-20201119.tar.gz
[illumos-gate merge]release-20201119
commit 5a0af8165ce9590e7a18f1ef4f9badc4dd72c6e6 13274 enable -fstack-protector-strong by default in user land commit 6a817834d81cc75ce12d0d393320837b1fec1e85 5788 Want support for GCC's stack protector in libc commit 350ffdd54baf880f440ddf9697666e283894ded1 13273 want upanic(2) commit 7fdea60d55a95f0e46066fd021c4ef1b1321bafc 13300 mlxcx_cq_setup() doesn't take required locks for ASSERTs Merge notes: - Manifest changes to match package changes (including shipping libssp_ns.a) - Modified lx_vdso tools to not include SSP, to match other build-only tools.
Diffstat (limited to 'usr/src/man/man2')
-rw-r--r--usr/src/man/man2/Makefile1
-rw-r--r--usr/src/man/man2/upanic.295
2 files changed, 96 insertions, 0 deletions
diff --git a/usr/src/man/man2/Makefile b/usr/src/man/man2/Makefile
index 8f664a56fc..60ed81daad 100644
--- a/usr/src/man/man2/Makefile
+++ b/usr/src/man/man2/Makefile
@@ -155,6 +155,7 @@ MANFILES= Intro.2 \
umount.2 \
uname.2 \
unlink.2 \
+ upanic.2 \
ustat.2 \
utime.2 \
utimes.2 \
diff --git a/usr/src/man/man2/upanic.2 b/usr/src/man/man2/upanic.2
new file mode 100644
index 0000000000..351b7939d0
--- /dev/null
+++ b/usr/src/man/man2/upanic.2
@@ -0,0 +1,95 @@
+.\"
+.\" 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 Computer Company
+.\"
+.Dd October 31, 2020
+.Dt UPANIC 2
+.Os
+.Sh NAME
+.Nm upanic
+.Nd user process panic
+.Sh SYNOPSIS
+.In upanic.h
+.Ft void noreturn
+.Fo upanic
+.Fa "const char *msg"
+.Fa "size_t len"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn 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
+.Xr core 4
+and controlled by
+.Xr coreadm 1M .
+.Pp
+Unlike
+.Xr abort 3C ,
+signals are not generated, which avoids two related challenges:
+.Bl -enum
+.It
+A signal handler attempting to catch a
+.Dv SIGABRT .
+.It
+Needing to make multiple system calls and potentially unmasking the
+signal.
+.El
+.Pp
+The
+.Fn upanic
+system call allows an optional message to be transmitted that will be
+put in a
+.Dv NT_UPANIC
+elf note in the resulting core file.
+If a message is not desired, then one should pass
+.Dv NULL
+for
+.Fa msg .
+In general, it is expected that
+.Fa msg
+is a character string with a human-readable message; however, it may
+include binary data.
+The system will copy
+.Fa len
+bytes regardless of whether the string has a NUL character to terminate
+it or not.
+If
+.Fa msg
+points to an invalid value or
+.Fa 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
+.Dv NT_UPANIC
+elf note.
+.Pp
+The
+.Fn upanic
+system call is illumos-specific and not portable to other systems.
+For portable applications, instead use
+.Xr abort 3C .
+.Sh RETURN VALUES
+The
+.Fn upanic
+system call does not return.
+It always terminates the process.
+.Sh INTERFACE STABILITY
+.Sy Committed
+.Sh MT-LEVEL
+.Sy Async-Signal-Safe
+.Sh SEE ALSO
+.Xr elfdump 1 ,
+.Xr mdb 1 ,
+.Xr coreadm 1M ,
+.Xr abort 3 ,
+.Xr upanic.h 3HEAD ,
+.Xr core 4