libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / system / libroot / posix / arch / generic / setjmp_save_sigs.c
bloba88362cf3e7ffa83e7c3dccdcb69f9217c202545
1 /*
2 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the Haiku License.
4 */
7 #include <setjmp.h>
10 /** This function is called by sigsetjmp() only */
12 int __setjmp_save_sigs(jmp_buf buffer, int saveMask);
14 int
15 __setjmp_save_sigs(jmp_buf buffer, int saveMask)
17 // If the signal mask shall be saved, we save the inverted signal mask. The
18 // reason for this is that due to unblockable signals the inverted signal
19 // mask is never zero and thus we can use a zero value to indicate that the
20 // mask has not been saved.
21 sigset_t signalMask;
22 if (saveMask != 0 && sigprocmask(SIG_BLOCK, NULL, &signalMask) == 0)
23 buffer[0].inverted_signal_mask = ~signalMask;
24 else
25 buffer[0].inverted_signal_mask = 0;
27 return 0;