xref: /openbsd/regress/sys/kern/signal/sigio/common.h (revision 6bcfccda)
1*6bcfccdaSmpi /*	$OpenBSD: common.h,v 1.1 2020/09/16 14:02:23 mpi Exp $	*/
2*6bcfccdaSmpi 
3*6bcfccdaSmpi /*
4*6bcfccdaSmpi  * Copyright (c) 2018 Visa Hankala
5*6bcfccdaSmpi  *
6*6bcfccdaSmpi  * Permission to use, copy, modify, and distribute this software for any
7*6bcfccdaSmpi  * purpose with or without fee is hereby granted, provided that the above
8*6bcfccdaSmpi  * copyright notice and this permission notice appear in all copies.
9*6bcfccdaSmpi  *
10*6bcfccdaSmpi  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11*6bcfccdaSmpi  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12*6bcfccdaSmpi  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13*6bcfccdaSmpi  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14*6bcfccdaSmpi  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15*6bcfccdaSmpi  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16*6bcfccdaSmpi  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*6bcfccdaSmpi  */
18*6bcfccdaSmpi 
19*6bcfccdaSmpi #define SIGIO_REGRESS_USER	"nobody"
20*6bcfccdaSmpi 
21*6bcfccdaSmpi /*
22*6bcfccdaSmpi  * Wait until signal signum arrives, or fail if a timeout occurs first.
23*6bcfccdaSmpi  */
24*6bcfccdaSmpi #define expect_signal(signum) \
25*6bcfccdaSmpi 	expect_signal_impl(signum, #signum, __FILE__, __LINE__)
26*6bcfccdaSmpi 
27*6bcfccdaSmpi /*
28*6bcfccdaSmpi  * Fail if signal signum is pending.
29*6bcfccdaSmpi  */
30*6bcfccdaSmpi #define reject_signal(signum) \
31*6bcfccdaSmpi 	reject_signal_impl(signum, #signum, __FILE__, __LINE__)
32*6bcfccdaSmpi 
33*6bcfccdaSmpi void	expect_signal_impl(int, const char *, const char *, int);
34*6bcfccdaSmpi void	reject_signal_impl(int, const char *, const char *, int);
35*6bcfccdaSmpi 
36*6bcfccdaSmpi int	test_common_badpgid(int);
37*6bcfccdaSmpi int	test_common_badsession(int);
38*6bcfccdaSmpi int	test_common_cansigio(int *);
39*6bcfccdaSmpi int	test_common_getown(int);
40*6bcfccdaSmpi int	test_common_read(int *);
41*6bcfccdaSmpi int	test_common_write(int *);
42*6bcfccdaSmpi int	test_pipe_badpgid(void);
43*6bcfccdaSmpi int	test_pipe_badsession(void);
44*6bcfccdaSmpi int	test_pipe_cansigio(void);
45*6bcfccdaSmpi int	test_pipe_getown(void);
46*6bcfccdaSmpi int	test_pipe_read(void);
47*6bcfccdaSmpi int	test_pipe_write(void);
48*6bcfccdaSmpi int	test_socket_badpgid(void);
49*6bcfccdaSmpi int	test_socket_badsession(void);
50*6bcfccdaSmpi int	test_socket_cansigio(void);
51*6bcfccdaSmpi int	test_socket_getown(void);
52*6bcfccdaSmpi int	test_socket_inherit(void);
53*6bcfccdaSmpi int	test_socket_read(void);
54*6bcfccdaSmpi int	test_socket_write(void);
55*6bcfccdaSmpi 
56*6bcfccdaSmpi void	test_init(void);
57*6bcfccdaSmpi void	test_barrier(int);
58*6bcfccdaSmpi int	test_fork(pid_t *, int *);
59*6bcfccdaSmpi int	test_wait(pid_t, int);
60*6bcfccdaSmpi #define PARENT	1
61*6bcfccdaSmpi #define CHILD	0
62