1 #include <pthread.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 
5 #include "tst-tpp.h"
6 
7 static pthread_mutexattr_t a;
8 
9 static void
prepare(void)10 prepare (void)
11 {
12   init_tpp_test ();
13 
14   if (pthread_mutexattr_init (&a) != 0)
15     {
16       puts ("mutexattr_init failed");
17       exit (1);
18     }
19 
20   if (pthread_mutexattr_setprotocol (&a, PTHREAD_PRIO_PROTECT) != 0)
21     {
22       puts ("mutexattr_setprotocol failed");
23       exit (1);
24     }
25 
26   if (pthread_mutexattr_setprioceiling (&a, 6) != 0)
27     {
28       puts ("mutexattr_setprioceiling failed");
29       exit (1);
30     }
31 }
32 #define PREPARE(argc, argv) prepare ()
33 
34 static int do_test (void);
35 
36 static int
do_test_wrapper(void)37 do_test_wrapper (void)
38 {
39   init_tpp_test ();
40   return do_test ();
41 }
42 #define TEST_FUNCTION do_test_wrapper ()
43 
44 #define ATTR &a
45 #define ATTR_NULL false
46 #include "tst-mutex6.c"
47