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_sigtimedwait(const sigset_t * set,siginfo_t * info,void * timeout)6*49cdfc7eSAndroid Build Coastguard Worker static int my_sigtimedwait(const sigset_t * set, siginfo_t * info,
7*49cdfc7eSAndroid Build Coastguard Worker void *timeout)
8*49cdfc7eSAndroid Build Coastguard Worker {
9*49cdfc7eSAndroid Build Coastguard Worker return sigtimedwait(set, info, timeout);
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 { test_bad_address3, SIGUSR1},
21*49cdfc7eSAndroid Build Coastguard Worker { test_timeout, 0},
22*49cdfc7eSAndroid Build Coastguard Worker };
23*49cdfc7eSAndroid Build Coastguard Worker
run(unsigned int i)24*49cdfc7eSAndroid Build Coastguard Worker static void run(unsigned int i)
25*49cdfc7eSAndroid Build Coastguard Worker {
26*49cdfc7eSAndroid Build Coastguard Worker struct sigwait_test_desc *tc = &tests[i];
27*49cdfc7eSAndroid Build Coastguard Worker
28*49cdfc7eSAndroid Build Coastguard Worker tc->tf(my_sigtimedwait, tc->signo, TST_LIBC_TIMESPEC);
29*49cdfc7eSAndroid Build Coastguard Worker }
30*49cdfc7eSAndroid Build Coastguard Worker
31*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = {
32*49cdfc7eSAndroid Build Coastguard Worker .test= run,
33*49cdfc7eSAndroid Build Coastguard Worker .tcnt = ARRAY_SIZE(tests),
34*49cdfc7eSAndroid Build Coastguard Worker .setup = sigwait_setup,
35*49cdfc7eSAndroid Build Coastguard Worker .forks_child = 1,
36*49cdfc7eSAndroid Build Coastguard Worker };
37