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