Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




23.3 Non-Local Exits and Signals

In BSD Unix systems, setjmp and longjmp also save and restore the set of blocked signals; see Blocking Signals. However, the POSIX.1 standard requires setjmp and longjmp not to change the set of blocked signals, and provides an additional pair of functions (sigsetjmp and siglongjmp) to get the BSD behavior.

The behavior of setjmp and longjmp in the GNU library is controlled by feature test macros; see Feature Test Macros. The default in the GNU system is the POSIX.1 behavior rather than the BSD behavior.

The facilities in this section are declared in the header file setjmp.h.

— Data Type: sigjmp_buf

This is similar to jmp_buf, except that it can also store state information about the set of blocked signals.

— Function: int sigsetjmp (sigjmp_buf state, int savesigs)

This is similar to setjmp. If savesigs is nonzero, the set of blocked signals is saved in state and will be restored if a siglongjmp is later performed with this state.

— Function: void siglongjmp (sigjmp_buf state, int value)

This is similar to longjmp except for the type of its state argument. If the sigsetjmp call that set this state used a nonzero savesigs flag, siglongjmp also restores the set of blocked signals.

  Published under the terms of the GNU General Public License Design by Interspire