7 /* Don't even try to compile. In fact, cause a syntax error that we can
8 look for as a compiler error message and know that we have no pthread
9 support. In that case we can just suppress the test completely. */
11 #error "no posix threads support"
15 /* OK. We have the right header. If we try to compile this and fail, then
16 there is something wrong and the user should know about it so the testsuite
17 should issue an ERROR result.. */
20 #define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0)
26 /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
27 is prototyped to be just a "pthread_attr_t", while under Solaris it
28 is a "pthread_attr_t *". Arg! */
30 #if defined (__osf__) || defined (__hpux__)
31 #define PTHREAD_CREATE_ARG2(arg) arg
32 #define PTHREAD_CREATE_NULL_ARG2 null_attr
33 static pthread_attr_t null_attr
;
35 #define PTHREAD_CREATE_ARG2(arg) &arg
36 #define PTHREAD_CREATE_NULL_ARG2 NULL
43 printf ("hello thread\n");
46 /* Marker function for the testsuite */
48 done_making_threads (void)
58 if (pthread_create (&tid
, PTHREAD_CREATE_NULL_ARG2
, routine
, (void *) 0xfeedface))
60 perror ("pthread_create 1");
66 main (int argc
, char *argv
[])
70 /* Create a few threads */
71 for (i
= 0; i
< 5; i
++)
73 done_making_threads ();
80 #endif /* ifndef HAVE_PTHREAD_H */