repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / tests / system / libroot / posix / abort_test.cpp
blobad56a60a51302cc2de69e24316d4e2d48c4cc833
1 /*
2 * Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <OS.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
14 static status_t
15 abort_thread(void*)
17 snooze(50000);
18 abort();
19 return 0;
23 int
24 main(int argc, char** argv)
26 thread_id thread = spawn_thread(&abort_thread, "abort test",
27 B_NORMAL_PRIORITY, NULL);
28 resume_thread(thread);
30 status_t status = wait_for_thread(thread, NULL);
31 fprintf(stderr, "abort thread aborted: %s\n", strerror(status));
33 snooze(1000000LL);
34 fprintf(stderr, "main exiting\n");
35 return 0;