diff options
Diffstat (limited to 'testsuite/systemtap.syscall/pipe.c')
-rw-r--r-- | testsuite/systemtap.syscall/pipe.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/pipe.c b/testsuite/systemtap.syscall/pipe.c new file mode 100644 index 00000000..36e86e9f --- /dev/null +++ b/testsuite/systemtap.syscall/pipe.c @@ -0,0 +1,27 @@ +/* COVERAGE: pipe pipe2 */ + +#define _GNU_SOURCE +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> + +int main() +{ + int pipefd[2]; + pipefd[0] = 42; + pipefd[1] = 13; + + pipe (pipefd); + //staptest// pipe (\[42, 13\]) = 0 + +#ifdef O_CLOEXEC + pipe2 (pipefd, O_CLOEXEC); + //staptest// pipe2 (\[NNNN, NNNN\], O_CLOEXEC) = 0 + + pipe2 (pipefd, O_CLOEXEC|O_NONBLOCK); + //staptest// pipe2 (\[NNNN, NNNN\], O_NONBLOCK|O_CLOEXEC) = 0 +#endif + + return 0; +} |