repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / tests / system / libroot / posix / sigsetjmp_test.c
blob22c4fb96d034f0c37f263d49775233c1682aaa12
1 /*
2 * Copyright 2005-2006, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <setjmp.h>
8 #include <stdio.h>
11 static void
12 jump_to_top_level(jmp_buf *state, int value)
14 siglongjmp(*state, value);
18 int
19 main(int argc, char **argv)
21 jmp_buf state;
22 int value;
24 if ((value = sigsetjmp(state, 1)) != 0) {
25 printf("failed with: %d!\n", value);
26 } else {
27 printf("here I am: %d\n", value);
28 jump_to_top_level(&state, 42);
29 printf("you won't see me!\n");
32 puts("done.");
33 return 0;