Files
haiku-beta6/src/tests/system/libroot/posix/setjmp_test.c
T
Axel Dörfler 9b28f8873c * Added sigsetjmp_test to Jamfile.
* Fixed Jamfile (was set to only support libbe_test).
* Fixed warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-14 21:43:39 +00:00

28 lines
437 B
C

/*
* Copyright 2005-2006, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
#include <setjmp.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
jmp_buf state;
int value;
if ((value = setjmp(state)) != 0) {
printf("failed with: %d!\n", value);
} else {
printf("here I am: %d\n", value);
longjmp(state, 42);
printf("you won't see me!\n");
}
puts("done.");
return 0;
}