siginterrupt(3)
β¨ siginterrupt(3) β¨
okay bestie, listen UP, we're in the Library Functions Manual and today's main character is siginterrupt(3). she's a little old, a little deprecated, but she's still out here doing her thing π
πΈ NAME πΈ
siginterrupt β let signals interrupt system calls, like the icon she is β¨
π LIBRARY π
Standard C library (libc, -lc) β the classic, no cap π«Ά
π SYNOPSIS π
#include <signal.h>
[[deprecated]] int siginterrupt(int sig, int flag);
π¦ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) π¦
siginterrupt():
_XOPEN_SOURCE >= 500
|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
|| /* glibc <= 2.19: */ _BSD_SOURCE
β¨ DESCRIPTION β¨
So siginterrupt() is the girl who decides what happens to a system call when the signal sig crashes the party. Basically she changes the restart behavior π
- If the
flagargument is false (0) β that's a fake, zero, nope β then system calls will be restarted if they get interrupted by the specified signalsig. And bestie, that's literally the default behavior in Linux. the norm. the baseline. periodt π - If the
flagargument is true (1) and no data has been transferred yet, then a system call interrupted by the signalsigwill return-1, anderrnogets set toEINTR. she's done, she's leaving, bye πͺ - If the
flagargument is true (1) and data transfer has already started, then the system call will be interrupted and will return the actual amount of data transferred. like, she got some of it in, but she's not finishing, sorry bestie, partial delivery π
π₯ RETURN VALUE π₯
siginterrupt() returns 0 on success π
She returns -1 if the signal number sig is invalid β and then errno is set to indicate the error. rude, but okay π
π ERRORS π
EINVALβ the specified signal number is invalid. like... girl, that's not a signal. π«
π ATTRIBUTES π
For an explanation of the terms used in this section, see attributes(7).
- Interface:
siginterrupt() - Attribute: Thread safety
- Value:
MT-Unsafe const:sigintr
β οΈ bestie READ IT: MT-Unsafe const:sigintr. she is not thread safe, so don't go handing her to every thread in the group chat π
π STANDARDS π
POSIX.1-2008.
π¦ HISTORY π¦
4.3BSD,POSIX.1-2001.- Obsolete in
POSIX.1-2008, which recommends usingsigaction(2)with theSA_RESTARTflag instead. so like, she's the vintage piece in the collection β iconic, but POSIX said "ma'am, we moved on" πβ¨
π«Ά SEE ALSO π«Ά
and that's the whole vibe, bestie π this page came from the Linux man-pages 6.20 era, dated 2026-02-08, so if you're citing her in an essay, you know exactly which glow-up season she's from ππΈπ¦
π¦ 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