1 #ifdef HAVE_CONFIG_H 2 # include "config.h" 3 #endif 4 5 #include <stdio.h> 6 #include <fcntl.h> 7 #include <unistd.h> 8 9 int 10 main(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 } 28