1 /* $NetBSD: recurse.c,v 1.2 2004/08/02 00:17:21 thorpej Exp $ */
4 * Written by Jason R. Thorpe, August 1, 2004.
17 static const ns_src testsrc
[] = {
18 { "test", NS_SUCCESS
},
23 func3(void *rv
, void *cb_data
, va_list ap
)
26 printf("func3: enter\n");
27 printf("func3: exit\n");
32 func2(void *rv
, void *cb_data
, va_list ap
)
34 static const ns_dtab dtab
[] = {
35 { "test", func3
, NULL
},
40 printf("func2: enter\n");
41 r
= nsdispatch(NULL
, dtab
, "test", "test", testsrc
);
42 printf("func2: exit\n");
49 static const ns_dtab dtab
[] = {
50 { "test", func2
, NULL
},
55 printf("func1: enter\n");
56 r
= nsdispatch(NULL
, dtab
, "test", "test", testsrc
);
57 printf("func1: exit\n");
69 main(int argc
, char *argv
[])
74 assert(pthread_create(&thr
, NULL
, thrfunc
, NULL
) == 0);
75 assert(func1() == NS_SUCCESS
);
76 assert(pthread_join(thr
, &threval
) == 0);