| 1 |
/* COVERAGE: pipe pipe2 */ |
| 2 |
|
| 3 |
#define _GNU_SOURCE |
| 4 |
#include <sys/types.h> |
| 5 |
#include <sys/stat.h> |
| 6 |
#include <fcntl.h> |
| 7 |
#include <unistd.h> |
| 8 |
|
| 9 |
int main() |
| 10 |
{ |
| 11 |
int pipefd[2]; |
| 12 |
pipefd[0] = 0; |
| 13 |
pipefd[1] = 0; |
| 14 |
|
| 15 |
pipe (pipefd); |
| 16 |
//staptest// [[[[pipe (\[0, 0\]!!!!pipe2 (\[0, 0\], 0x0]]]]) = 0 |
| 17 |
|
| 18 |
#ifdef O_CLOEXEC |
| 19 |
/* Test calling pipe2() with 0, to make sure we don't confuse it |
| 20 |
* with pipe(). */ |
| 21 |
pipe2 (pipefd, 0); |
| 22 |
//staptest// pipe2 (\[NNNN, NNNN\], 0x0) = 0 |
| 23 |
|
| 24 |
pipe2 (pipefd, O_CLOEXEC); |
| 25 |
//staptest// pipe2 (\[NNNN, NNNN\], O_CLOEXEC) = 0 |
| 26 |
|
| 27 |
pipe2 (pipefd, O_CLOEXEC|O_NONBLOCK); |
| 28 |
//staptest// pipe2 (\[NNNN, NNNN\], O_NONBLOCK|O_CLOEXEC) = 0 |
| 29 |
|
| 30 |
pipe2 ((int *)-1, O_CLOEXEC|O_NONBLOCK); |
| 31 |
//staptest// pipe2 (\[0, 0\], O_NONBLOCK|O_CLOEXEC) = -NNNN |
| 32 |
|
| 33 |
pipe2 (pipefd, -1); |
| 34 |
//staptest// pipe2 (\[NNNN, NNNN\], O_[^ ]+|XXXX) = -NNNN |
| 35 |
#endif |
| 36 |
|
| 37 |
return 0; |
| 38 |
} |