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 function gsignal(), and it returns the previous such action or SIG_DFL. πŸ’–
  • The function gsignal() does the following:
    1. If no action (or the action SIG_DFL) was specified for signum, then it does nothing and returns 0.
    2. If the action SIG_IGN was specified for signum, then it does nothing and returns 1.
    3. Otherwise, it resets the action to SIG_DFL and calls the action function with argument signum, and returns the value returned by that function.

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-Safe
  • ssignal() β€” 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms