SIGLONGJMP(3POSIX)
πΈ SIGLONGJMP π
okay bestie, so this one's from the POSIX Programmer's Manual β that's the manual this page lives in. Just a heads up before we dive in: the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface might not even be implemented on Linux at all. π
β¨ PROLOG β¨
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
π NAME π
siglongjmp β non-local goto with signal handling. yeah. it jumps. but make it signal-aware. β¨
π SYNOPSIS π
#include <setjmp.h>
void siglongjmp(sigjmp_buf env, int val);
π DESCRIPTION π
So siglongjmp() is literally the same vibe as the longjmp() function, except for these two things, and you gotta know both of them:
- References to
setjmp()shall be equivalent tosigsetjmp(). πͺ - The
siglongjmp()function shall restore the saved signal mask if and only if theenvargument was initialized by a call tosigsetjmp()with a non-zerosavemaskargument. no nonzerosavemask, no mask restore. that's the whole deal. π
π RETURN VALUE π
Once siglongjmp() is completed, program execution shall continue as if the corresponding invocation of sigsetjmp() had just returned the value specified by val. it's giving time travel but make it a function call. π¦
Also, super important: the siglongjmp() function shall not cause sigsetjmp() to return 0. So if val is 0, then sigsetjmp() shall return the value 1 instead. yeah, it just does that. no cap. β
π ERRORS π
No errors are defined. iconic behavior honestly. π«Ά
The following sections are informative. (so like, the rest of this is context, not contract, iykyk)
π EXAMPLES π
None.
π§ APPLICATION USAGE π§
The distinction between setjmp() or longjmp() and sigsetjmp() or siglongjmp() is only significant for programs which use sigaction(), sigprocmask(), or sigsuspend(). if you're not touching those three, this whole signal-mask subplot is not your problem bestie. π
πΈ RATIONALE πΈ
None.
β FUTURE DIRECTIONS β
None.
π SEE ALSO π
longjmp()pthread_sigmask()setjmp()sigsetjmp()sigsuspend()
The Base Definitions volume of POSIX.1β2017, <setjmp.h> β go read it, it's right there. π
π 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. 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 the whole page, bestie!! courtesy of IEEE/The Open Group, 2017, filed under SIGLONGJMP(3POSIX). mwah, go restore that signal mask 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