gsignal(3)
π gsignal(3) β library functions manual, bestie edition π
okay so bestie, we need to talk about gsignal and ssignal π«Ά this is a page from the Library Functions Manual, and honestly? the whole vibe is "please don't". buckle up.
β¨ NAME β¨
gsignal, ssignal β the software signal facility π
π LIBRARY π
Standard C library (libc, -lc) πΈ
π SYNOPSIS π
#include <signal.h>
typedef typeof(void (int)) *sighandler_t;
[[deprecated]] int gsignal(int signum);
[[deprecated]] sighandler_t ssignal(int signum, sighandler_t action);
π§ Feature Test Macro Requirements for glibc π§
(peep feature_test_macros(7) for the lore, bestie)
gsignal(), ssignal():
- Since glibc 2.19:
_DEFAULT_SOURCE - glibc 2.19 and earlier:
_SVID_SOURCE
π DESCRIPTION π
Do NOT use these functions under Linux. like, not even a little. π
Due to a historical mistake, under Linux these functions are literally just aliases for raise(3) and signal(2) respectively. so if you were expecting software signal shenanigans, surprise! you got regular ones. it's giving "oops".
Elsewhere, like on System V-like systems, things are different in a lowkey fascinating way β these functions implement software signaling, entirely independent of the classical signal(2) and kill(2) functions. no cap.
- The function
ssignal()defines the action to take when the software signal with number signum is raised using the functiongsignal(), and it returns the previous such action orSIG_DFL. π - The function
gsignal()does the following:- If no action (or the action
SIG_DFL) was specified for signum, then it does nothing and returns0. - If the action
SIG_IGNwas specified for signum, then it does nothing and returns1. - Otherwise, it resets the action to
SIG_DFLand calls the action function with argument signum, and returns the value returned by that function.
- If no action (or the action
The range of possible values for signum varies β often 1β15 or 1β17. so it's not even a fixed thing, iconic behavior honestly π
π¦ ATTRIBUTES π¦
for an explanation of the terms used in this section, go read attributes(7) bestie, it's all there. β¨
gsignal()β Thread safety:MT-Safessignal()β Thread safety:MT-Safe sigintr
π STANDARDS π
None. literally none. that's it, that's the whole section. π
πΈ HISTORY πΈ
These showed up on AIX, DG/UX, HP-UX, SCO, Solaris, Tru64. they're called obsolete under most of these systems, and they're broken under glibc β which is a big yikes but we move. π
Some systems also have gsignal_r() and ssignal_r(). iykyk.
π«Ά SEE ALSO π«Ά
and that's the whole page, bestie β¨ go use raise(3) instead, i'm begging π
mwah π this was page gsignal(3) from Linux man-pages 6.20, dated 2026-02-08. periodt. π
π¦ 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 2002, Andries E. Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms