etc/services - sync with NetBSD-8
[minix.git] / minix / tests / ddekit / ddekittest_driver.c
blobe211d99dfe58f6230f623535f240dc8f457cf518
1 #include <ddekit/ddekit.h>
2 #include <ddekit/printf.h>
3 #include <ddekit/thread.h>
4 #include <ddekit/initcall.h>
6 #include <stdio.h>
8 void
9 long_running_thread()
11 int x=10;
12 do {
13 ddekit_printf("Long Running\n");
14 ddekit_thread_msleep(2000);
15 x--;
16 } while(x >0);
19 void
20 short_running_thread()
22 int x=15;
23 do {
24 ddekit_printf("Short Running\n");
25 ddekit_thread_msleep(500);
26 x--;
27 } while(x >0);
30 void ddekit_minix_wait_exit(void); /* import from dde-minix */
32 #if 0
33 #include <ucontext.h>
34 ucontext_t ctx;
35 #endif
37 int
38 main(void)
41 #if 0
42 getcontext(&ctx);
43 if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
44 printf("FLAG_NONE\n");
47 memset(&ctx,0,sizeof(ucontext_t));
48 ctx.uc_flags = _UC_IGNSIGM | _UC_IGNFPU;
49 getcontext(&ctx);
50 if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
51 printf("_UC_IGNSIGM | _UC_IGNFPU FAIL\n");
54 memset(&ctx,0,sizeof(ucontext_t));
55 ctx.uc_flags = _UC_IGNSIGM ;
56 getcontext(&ctx);
57 if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
58 printf("_UC_IGNSIGM FAIL\n");
61 memset(&ctx,0,sizeof(ucontext_t));
62 ctx.uc_flags = _UC_IGNFPU ;
63 getcontext(&ctx);
64 if (ctx.uc_mcontext.mc_magic != 0xc0ffee) {
65 printf("_UC_IGNFPU FAIL\n");
67 #endif
69 ddekit_init();
70 ddekit_thread_create(long_running_thread, NULL, "Long_thread");
71 ddekit_thread_create(short_running_thread, NULL, "Short_thread");
72 ddekit_minix_wait_exit();
74 return 0;