xref: /dragonfly/test/libpthread/hello_s.c (revision c9c5aa9e)
1 /****************************************************************************
2  *
3  * Simple sequence mode test.
4  *
5  * $FreeBSD: src/lib/libc_r/test/hello_s.c,v 1.1.2.1 2000/07/17 22:18:32 jasone Exp $
6  *
7  ****************************************************************************/
8 
9 #include <stdio.h>
10 #include <string.h>
11 #include <pthread.h>
12 
13 void *
14 entry(void * a_arg)
15 {
16 	fprintf(stderr, "ok 1\n");
17 	fprintf(stderr, "ok \n");
18 	fprintf(stderr, "ok 3\n");
19 
20 	return NULL;
21 }
22 
23 int
24 main()
25 {
26 	pthread_t thread;
27 	int error;
28 
29 	fprintf(stderr, "1..3\n");
30 
31 	fprintf(stderr, "Some random text\n");
32 
33 	error = pthread_create(&thread, NULL, entry, NULL);
34 	fprintf(stderr, "More unimportant text\n");
35 	if (error)
36 		fprintf(stderr,"Error in pthread_create(): %s\n",
37 			strerror(error));
38 
39 	error = pthread_join(thread, NULL);
40 	if (error)
41 		fprintf(stderr,	"Error in pthread_join(): %s\n",
42 			strerror(error));
43 
44 	fprintf(stderr, "Hello world\n");
45 
46 	return 0;
47 }
48