From a5d8d92a7c3b1ad18d6da416d4bb08922578f502 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 19 Mar 2010 16:55:10 +0100 Subject: Add testcase for syscall.pipe. --- testsuite/systemtap.syscall/pipe.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 testsuite/systemtap.syscall/pipe.c (limited to 'testsuite/systemtap.syscall/pipe.c') 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 +#include +#include +#include + +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; +} -- cgit