psignal(3)
π psignal(3) β the tea on printing signal descriptions π
okay bestie, gather round, because today we're talking about psignal and psiginfo, two little library functions living their best lives in the Library Functions Manual section 3. they do NOT return anything, they do NOT judge you, they just print. iconic behaviour honestly. π«Ά
β¨ NAME β¨
psignal, psiginfo β print signal description π
π LIBRARY π
Standard C library (libc, -lc). yeah girl, she's the standard one, you already have her. πΈ
π SYNOPSIS π
#include <signal.h>
void psignal(int sig, const char *s);
void psiginfo(const siginfo_t *pinfo, const char *s);
π¦ Feature Test Macro Requirements for glibc π¦
(if you're confused about what a feature test macro even IS, go read feature_test_macros(7), it's giving lore.)
psignal():
- Since glibc 2.19:
_DEFAULT_SOURCE - glibc 2.19 and earlier:
_BSD_SOURCE || _SVID_SOURCE
psiginfo():
_POSIX_C_SOURCE >= 200809L
π DESCRIPTION π
okay so psignal() displays a message on stderr. and the way that it works is SO specific, let me break it down bestie: the message is
- the string
s, - a colon,
- a space,
- a string describing the signal number
sig, - and a trailing newline.
that's the whole recipe. no notes. π
BUT β and this is the plot twist β if the string s is NULL or empty, then the colon and the space get dropped. gone. they do not make the cut. and if sig is invalid? the message displayed will indicate an unknown signal. it said what it said. π
now for psiginfo(), she's like psignal()'s cooler older sister. except that she displays information about the signal described by pinfo, which should point to a valid siginfo_t structure (yes bestie, valid, this is not optional, we are not playing games here π). as well as the signal description, psiginfo() also displays information about the origin of the signal, plus other information relevant to the signal. like:
- the relevant memory address, for hardware-generated signals,
- the child process ID, for
SIGCHLD, - the user ID and process ID of the sender, for signals set using
kill(2)orsigqueue(3).
so much information. so much slay. π₯
π« RETURN VALUE π«
psignal() and psiginfo() return no value. they give you nothing back. they are purely doing it for the plot. not everything is transactional bestie, sometimes a function just prints and moves on. β¨
β ATTRIBUTES β
for an explanation of all the terms used in this section, go check attributes(7), she explains everything.
- Interface:
psignal(),psiginfo() - Attribute: Thread safety
- Value:
MT-Safe locale
that's a big W. MT-Safe, no cap. π
π STANDARDS π
POSIX.1-2008. periodt.
π°οΈ HISTORY π°οΈ
glibc 2.10. also POSIX.1-2008, and 4.3BSD. so she's been around a while. veteran energy. π
π BUGS π
up to glibc 2.12, psiginfo() had the following bugs. and like, past-tense bugs, so we're not mad, we're just documenting the lore:
- In some circumstances, a trailing newline is not printed. (the newline said "not today" π)
- Additional details are not displayed for real-time signals.
ngl if you're on a glibc older than 2.12 and things look weird, that's why. you're not going crazy, it's just historical. π«Ά
π SEE ALSO π
and that's the whole vibe bestie. this page came to you from Linux man-pages 6.20, dated 2026-02-08, and honestly? she ate. now go print some signal descriptions. mwah. π ππ¦
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 1993, David Metcalfe <david@prism.demon.co.uk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms