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; usesigaction(2)instead. yes fr fr, this is the actual advice, straight from the source, no editorializing from me π - On older Linux systems,
sysv_signal()andsignal(2)were equivalent. But on newer systems,signal(2)provides reliable signal semantics; seesignal(2)for details. glow-up arc β¨ - The use of
sighandler_tis a GNU extension; this type is defined only if the_GNU_SOURCEfeature 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 avoidsysv_signal()and go tosigaction(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
- Copyright 2007, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms