blob: 6a5306f3658fccb772b252468bdc958f2c7caf26 [file] [log] [blame]
Dmitry V. Levin78ed3f32015-03-23 00:04:27 +00001#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6#include <fcntl.h>
7#include <unistd.h>
8
9int
10main(void)
11{
12 (void) close(0);
13 (void) close(1);
14 int fds[2];
15 if (pipe(fds) || fds[0] != 0 || fds[1] != 1)
16 return 77;
17
18#ifdef HAVE_PIPE2
19 (void) close(0);
20 (void) close(1);
21 if (pipe2(fds, O_NONBLOCK) || fds[0] != 0 || fds[1] != 1)
22 return 77;
23 return 0;
24#else
25 return 77;
26#endif
27}