xref: /haiku/src/system/libroot/posix/arch/generic/setjmp_save_sigs.c (revision cda5b8808fd0262f0fac472f6cfa809f846a83cf)
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
5 
6 
7 #include <setjmp.h>
8 
9 
10 /** This function is called by sigsetjmp() only */
11 
12 int __setjmp_save_sigs(jmp_buf buffer, int saveMask);
13 
14 int
15 __setjmp_save_sigs(jmp_buf buffer, int saveMask)
16 {
17 	buffer[0].mask_was_saved = saveMask && sigprocmask(SIG_BLOCK, NULL, &buffer[0].saved_mask) == 0;
18 		// only set mask_was_saved if sigprocmask() was successful
19 
20 	return 0;
21 }
22