9 static pthread_barrier_t b
;
10 static pthread_t main_thread
;
17 int e
= pthread_barrier_wait (&b
);
18 if (e
!= 0 && e
!= PTHREAD_BARRIER_SERIAL_THREAD
)
20 puts ("child: barrier_wait failed");
24 /* There is unfortunately no other way to try to make sure the other
25 thread reached the aio_suspend call. This test could fail on
26 highly loaded machines. */
29 pthread_kill (main_thread
, SIGUSR1
);
48 main_thread
= pthread_self ();
54 sigemptyset (&sa
.sa_mask
);
56 if (sigaction (SIGUSR1
, &sa
, NULL
) != 0)
58 puts ("sigaction failed");
62 if (pthread_barrier_init (&b
, NULL
, 2) != 0)
64 puts ("barrier_init");
77 req
.aio_fildes
= fds
[0];
78 req
.aio_lio_opcode
= LIO_READ
;
82 req
.aio_nbytes
= sizeof (buf
);
83 req
.aio_sigevent
.sigev_notify
= SIGEV_NONE
;
86 if (pthread_create (&th
, NULL
, tf
, NULL
) != 0)
88 puts ("create failed");
92 int e
= pthread_barrier_wait (&b
);
93 if (e
!= 0 && e
!= PTHREAD_BARRIER_SERIAL_THREAD
)
95 puts ("parent: barrier_wait failed");
99 struct aiocb
*list
[1];
102 e
= lio_listio (LIO_WAIT
, list
, 1, NULL
);
105 puts ("lio_listio succeeded");
110 printf ("lio_listio did not return EINTR: %d (%d = %m)\n", e
, errno
);
117 #define TEST_FUNCTION do_test ()
119 #include "../test-skeleton.c"