1 /*
2 * Check decoding of pipe syscall.
3 *
4 * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
5 * Copyright (c) 2015-2021 The strace developers.
6 * All rights reserved.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11 #include "tests.h"
12 #include "scno.h"
13
14 #ifdef __NR_pipe
15
16 # include <stdio.h>
17 # include <fcntl.h>
18 # include <unistd.h>
19
20 int
21 main(void)
22 {
23 (void) close(0);
24 (void) close(1);
25 int *const fds = tail_alloc(sizeof(*fds) * 2);
26 if (pipe(fds))
27 perror_msg_and_fail("pipe");
28
29 return 0;
30 }
31
32 #else
33
34 SKIP_MAIN_UNDEFINED("__NR_pipe")
35
36 #endif