1f08c3bdfSopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
2f08c3bdfSopenharmony_ci/* Copyright (c) Jiri Palecek<jpalecek@web.de>, 2009 */
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_ci#include "libsigwait.h"
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_cistatic int my_sigtimedwait(const sigset_t * set, siginfo_t * info,
7f08c3bdfSopenharmony_ci			   void *timeout)
8f08c3bdfSopenharmony_ci{
9f08c3bdfSopenharmony_ci	return sigtimedwait(set, info, timeout);
10f08c3bdfSopenharmony_ci}
11f08c3bdfSopenharmony_ci
12f08c3bdfSopenharmony_cistruct sigwait_test_desc tests[] = {
13f08c3bdfSopenharmony_ci	{ test_empty_set, SIGUSR1},
14f08c3bdfSopenharmony_ci	{ test_unmasked_matching, SIGUSR1},
15f08c3bdfSopenharmony_ci	{ test_masked_matching, SIGUSR1},
16f08c3bdfSopenharmony_ci	{ test_unmasked_matching_noinfo, SIGUSR1},
17f08c3bdfSopenharmony_ci	{ test_masked_matching_noinfo, SIGUSR1},
18f08c3bdfSopenharmony_ci	{ test_bad_address, SIGUSR1},
19f08c3bdfSopenharmony_ci	{ test_bad_address2, SIGUSR1},
20f08c3bdfSopenharmony_ci	{ test_bad_address3, SIGUSR1},
21f08c3bdfSopenharmony_ci	{ test_timeout, 0},
22f08c3bdfSopenharmony_ci};
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_cistatic void run(unsigned int i)
25f08c3bdfSopenharmony_ci{
26f08c3bdfSopenharmony_ci	struct sigwait_test_desc *tc = &tests[i];
27f08c3bdfSopenharmony_ci
28f08c3bdfSopenharmony_ci	tc->tf(my_sigtimedwait, tc->signo, TST_LIBC_TIMESPEC);
29f08c3bdfSopenharmony_ci}
30f08c3bdfSopenharmony_ci
31f08c3bdfSopenharmony_cistatic struct tst_test test = {
32f08c3bdfSopenharmony_ci	.test= run,
33f08c3bdfSopenharmony_ci	.tcnt = ARRAY_SIZE(tests),
34f08c3bdfSopenharmony_ci	.setup = sigwait_setup,
35f08c3bdfSopenharmony_ci	.forks_child = 1,
36f08c3bdfSopenharmony_ci};
37