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 flag argument is false (0) β€” that's a fake, zero, nope β€” then system calls will be restarted if they get interrupted by the specified signal sig. And bestie, that's literally the default behavior in Linux. the norm. the baseline. periodt πŸ’…
  • If the flag argument is true (1) and no data has been transferred yet, then a system call interrupted by the signal sig will return -1, and errno gets set to EINTR. she's done, she's leaving, bye πŸšͺ
  • If the flag argument 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 using sigaction(2) with the SA_RESTART flag 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms