1*6bcfccdaSmpi /* $OpenBSD: sigio_pipe.c,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 #include <assert.h>
20*6bcfccdaSmpi #include <fcntl.h>
21*6bcfccdaSmpi #include <signal.h>
22*6bcfccdaSmpi #include <unistd.h>
23*6bcfccdaSmpi
24*6bcfccdaSmpi #include "common.h"
25*6bcfccdaSmpi
26*6bcfccdaSmpi int
test_pipe_badpgid(void)27*6bcfccdaSmpi test_pipe_badpgid(void)
28*6bcfccdaSmpi {
29*6bcfccdaSmpi int fds[2];
30*6bcfccdaSmpi
31*6bcfccdaSmpi assert(pipe(fds) == 0);
32*6bcfccdaSmpi return test_common_badpgid(fds[0]);
33*6bcfccdaSmpi }
34*6bcfccdaSmpi
35*6bcfccdaSmpi int
test_pipe_badsession(void)36*6bcfccdaSmpi test_pipe_badsession(void)
37*6bcfccdaSmpi {
38*6bcfccdaSmpi int fds[2];
39*6bcfccdaSmpi
40*6bcfccdaSmpi assert(pipe(fds) == 0);
41*6bcfccdaSmpi return test_common_badsession(fds[0]);
42*6bcfccdaSmpi }
43*6bcfccdaSmpi
44*6bcfccdaSmpi int
test_pipe_cansigio(void)45*6bcfccdaSmpi test_pipe_cansigio(void)
46*6bcfccdaSmpi {
47*6bcfccdaSmpi int fds[2];
48*6bcfccdaSmpi
49*6bcfccdaSmpi assert(pipe(fds) == 0);
50*6bcfccdaSmpi return test_common_cansigio(fds);
51*6bcfccdaSmpi }
52*6bcfccdaSmpi
53*6bcfccdaSmpi int
test_pipe_getown(void)54*6bcfccdaSmpi test_pipe_getown(void)
55*6bcfccdaSmpi {
56*6bcfccdaSmpi int fds[2];
57*6bcfccdaSmpi
58*6bcfccdaSmpi assert(pipe(fds) == 0);
59*6bcfccdaSmpi return test_common_getown(fds[0]);
60*6bcfccdaSmpi }
61*6bcfccdaSmpi
62*6bcfccdaSmpi int
test_pipe_read(void)63*6bcfccdaSmpi test_pipe_read(void)
64*6bcfccdaSmpi {
65*6bcfccdaSmpi int fds[2];
66*6bcfccdaSmpi
67*6bcfccdaSmpi assert(pipe(fds) == 0);
68*6bcfccdaSmpi return test_common_read(fds);
69*6bcfccdaSmpi }
70*6bcfccdaSmpi
71*6bcfccdaSmpi int
test_pipe_write(void)72*6bcfccdaSmpi test_pipe_write(void)
73*6bcfccdaSmpi {
74*6bcfccdaSmpi int fds[2];
75*6bcfccdaSmpi
76*6bcfccdaSmpi assert(pipe(fds) == 0);
77*6bcfccdaSmpi return test_common_write(fds);
78*6bcfccdaSmpi }
79