xref: /aosp_15_r20/external/ltp/include/libsigwait.h (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2020 Linaro Limited. All rights reserved.
4*49cdfc7eSAndroid Build Coastguard Worker  * Author: Viresh Kumar <[email protected]>
5*49cdfc7eSAndroid Build Coastguard Worker  */
6*49cdfc7eSAndroid Build Coastguard Worker 
7*49cdfc7eSAndroid Build Coastguard Worker #ifndef SIGWAIT_H__
8*49cdfc7eSAndroid Build Coastguard Worker #define SIGWAIT_H__
9*49cdfc7eSAndroid Build Coastguard Worker 
10*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h"
11*49cdfc7eSAndroid Build Coastguard Worker #include "tst_timer.h"
12*49cdfc7eSAndroid Build Coastguard Worker #include <signal.h>
13*49cdfc7eSAndroid Build Coastguard Worker 
14*49cdfc7eSAndroid Build Coastguard Worker /* swi: sigwaitinfo() */
15*49cdfc7eSAndroid Build Coastguard Worker typedef int (*swi_func) (const sigset_t * set, siginfo_t * info,
16*49cdfc7eSAndroid Build Coastguard Worker 			 void * timeout);
17*49cdfc7eSAndroid Build Coastguard Worker typedef void (*test_func) (swi_func, int, enum tst_ts_type type);
18*49cdfc7eSAndroid Build Coastguard Worker 
19*49cdfc7eSAndroid Build Coastguard Worker struct sigwait_test_desc {
20*49cdfc7eSAndroid Build Coastguard Worker 	test_func tf;
21*49cdfc7eSAndroid Build Coastguard Worker 	int signo;
22*49cdfc7eSAndroid Build Coastguard Worker };
23*49cdfc7eSAndroid Build Coastguard Worker 
24*49cdfc7eSAndroid Build Coastguard Worker void test_empty_set(swi_func sigwaitinfo, int signo,
25*49cdfc7eSAndroid Build Coastguard Worker 		    enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
26*49cdfc7eSAndroid Build Coastguard Worker void test_timeout(swi_func sigwaitinfo, int signo, enum tst_ts_type type);
27*49cdfc7eSAndroid Build Coastguard Worker void test_unmasked_matching(swi_func sigwaitinfo, int signo,
28*49cdfc7eSAndroid Build Coastguard Worker 			    enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
29*49cdfc7eSAndroid Build Coastguard Worker void test_unmasked_matching_noinfo(swi_func sigwaitinfo, int signo,
30*49cdfc7eSAndroid Build Coastguard Worker 				   enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
31*49cdfc7eSAndroid Build Coastguard Worker void test_masked_matching(swi_func sigwaitinfo, int signo,
32*49cdfc7eSAndroid Build Coastguard Worker 			  enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
33*49cdfc7eSAndroid Build Coastguard Worker void test_masked_matching_rt(swi_func sigwaitinfo, int signo,
34*49cdfc7eSAndroid Build Coastguard Worker 			     enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
35*49cdfc7eSAndroid Build Coastguard Worker void test_masked_matching_noinfo(swi_func sigwaitinfo, int signo,
36*49cdfc7eSAndroid Build Coastguard Worker 				 enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
37*49cdfc7eSAndroid Build Coastguard Worker void test_bad_address(swi_func sigwaitinfo, int signo,
38*49cdfc7eSAndroid Build Coastguard Worker 		      enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
39*49cdfc7eSAndroid Build Coastguard Worker void test_bad_address2(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED,
40*49cdfc7eSAndroid Build Coastguard Worker 		       enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
41*49cdfc7eSAndroid Build Coastguard Worker void test_bad_address3(swi_func sigwaitinfo, int signo LTP_ATTRIBUTE_UNUSED,
42*49cdfc7eSAndroid Build Coastguard Worker 		       enum tst_ts_type type LTP_ATTRIBUTE_UNUSED);
43*49cdfc7eSAndroid Build Coastguard Worker void sigwait_setup(void);
44*49cdfc7eSAndroid Build Coastguard Worker #endif /* SIGWAIT_H__ */
45