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