SIGINTERRUPT(3POSIX)
π SIGINTERRUPT(3POSIX) β bestie edition π
okay so this one's from the POSIX Programmer's Manual, and I'm gonna hold your hand through it, no gatekeeping. β¨
πΈ PROLOG πΈ
so like, real talk first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so if you're on Linux, go read the corresponding Linux manual page for the actual tea on Linux behavior), or honestly the interface may not even be implemented on Linux at all. π Not me warning you before we even start.
β¨ NAME β¨
siginterrupt β the function that lets signals interrupt functions. it's giving "let me interrupt you real quick" π
π SYNOPSIS π
#include <signal.h>
int siginterrupt(int sig, int flag);
π DESCRIPTION π
So siginterrupt() shall change the restart behavior when a function is interrupted by the specified signal. Like, when a signal shows up mid-function, do we restart the function or not? That's the whole vibe check.
The function siginterrupt(sig, flag) has an effect as if it were implemented exactly like this, and I need you to read every line because the details matter, bestie:
int siginterrupt(int sig, int flag) {
int ret;
struct sigaction act;
(void) sigaction(sig, NULL, &act);
if (flag)
act.sa_flags &= ~SA_RESTART;
else
act.sa_flags |= SA_RESTART;
ret = sigaction(sig, &act, NULL);
return ret;
}
like. that's literally it. that's the whole thing. π«Ά
β RETURN VALUE β
Upon successful completion, siginterrupt() shall return 0. Otherwise, -1 shall be returned and errno gets set to indicate the error. classic. π
π₯ ERRORS π₯
The siginterrupt() function shall fail if:
EINVALβ thesigargument is not a valid signal number. bestie. that's not a real signal. π
The following sections are informative. (so like, the drama is over, these are just the extra notes π)
π EXAMPLES π
None. yeah. there's just... nothing here. iconic of them honestly. π
π¦ APPLICATION USAGE π¦
The siginterrupt() function supports programs written to historical system interfaces. (vintage! nostalgic! a little crusty!)
Applications should use the sigaction() with the SA_RESTART flag instead of the obsolescent siginterrupt() function. so like, it's not broken, it's just old. use the new one, please, for me. π
π RATIONALE π
None. no thoughts, head empty, nothing to justify. β¨
π§ FUTURE DIRECTIONS π§
None. it's just gonna keep existing like that. π«
π SEE ALSO π
- Section 2.4, Signal Concepts
sigaction()- The Base Definitions volume of POSIX.1β2017,
<signal.h>
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.
In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. (they're the final boss, fr fr. don't argue with them.) The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's a wrap, bestie!! this page was served up by IEEE/The Open Group, dated 2017, under the SIGINTERRUPT(3POSIX) banner π go forth and interrupt responsibly β¨π
π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms