sysv_signal(3)

✨ sysv_signal(3) ✨

okay bestie, so this one lives in the Library Functions Manual and it's giving "vintage but make it cursed" πŸ’… it's a libc function, we're in section 3, let's GO πŸ¦‹


🌸 NAME 🌸

sysv_signal β€” signal handling with System V semantics


πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc)


✨ SYNOPSIS ✨

#define _GNU_SOURCE         /* See feature_test_macros(7) */
#include <signal.h>

typedef typeof(void (int))  *sighandler_t;

sighandler_t sysv_signal(int signum, sighandler_t handler);

πŸ’– DESCRIPTION πŸ’–

So sysv_signal() takes the exact same arguments and does the exact same job as signal(2). Same energy, same vibe, same task. 🫢

BUT. And it's a big but. sysv_signal() serves you the System V unreliable signal semantics β€” lowercase unreliable, that's literally the name, not me being shady. Here's what that actually means:

  • a) the disposition of the signal gets reset to the default when the handler is invoked 😭
  • b) delivery of further instances of the signal is not blocked while the signal handler is executing πŸ™ˆ
  • c) and if the handler interrupts (certain) blocking system calls, then the system call is not automatically restarted πŸ’€

like... that's the whole thing. that's the function. iconic in a historical-artifact way ⭐


πŸ”₯ RETURN VALUE πŸ”₯

sysv_signal() hands you back the previous value of the signal handler β€” or SIG_ERR if something went wrong πŸ‘


πŸ“ ERRORS πŸ“

As for signal(2). (yes queen, go read that one, it's got the receipts πŸ“œ)


πŸ‘‘ ATTRIBUTES πŸ‘‘

For an explanation of the terms used in this section, see attributes(7).

  • Interface: sysv_signal()
  • Attribute: Thread safety
  • Value: MT-Safe

so like, thread-safe bestie, we love that for her πŸ’œ (the table said it, I'm just relaying it, no cap)


🌈 VERSIONS 🌈

  • Use of sysv_signal() should be avoided; use sigaction(2) instead. yes fr fr, this is the actual advice, straight from the source, no editorializing from me πŸ™
  • On older Linux systems, sysv_signal() and signal(2) were equivalent. But on newer systems, signal(2) provides reliable signal semantics; see signal(2) for details. glow-up arc ✨
  • The use of sighandler_t is a GNU extension; this type is defined only if the _GNU_SOURCE feature test macro is defined. so if you forgot your #define _GNU_SOURCE, that type just... isn't there. vibe check failed πŸ’…

🧚 STANDARDS 🧚

None.

(that's it. that's the whole standard. it's giving unstandardized and proud πŸŽ€)


πŸ’« SEE ALSO πŸ’«


⚠️ real talk for one sec: the doc literally says to avoid sysv_signal() and go to sigaction(2) instead. this isn't me being dramatic, it's in VERSIONS. protect your signal handling bestie 🫢

and that's the whole page!! 🌸 this lil slice of the Linux man-pages 6.20, dated 2026-02-08, is done and dusted. go forth and sigaction(2) instead, 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms