]> granicus.if.org Git - strace/blob - tests/pipe.c
2b3e550d00b45e225d9b2794ccf9cdadc2b804d5
[strace] / tests / pipe.c
1 /*
2  * Check decoding of pipe syscall.
3  *
4  * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
5  * Copyright (c) 2015-2017 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 <asm/unistd.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