summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2010-03-19 16:55:10 +0100
committerMark Wielaard <mjw@redhat.com>2010-03-19 16:55:10 +0100
commita5d8d92a7c3b1ad18d6da416d4bb08922578f502 (patch)
tree8784d45c2b6ebcdb9ec13c59b67265ae01730065
parent7a95843846ea6a5f626dfeb63a26477e1f228dc4 (diff)
downloadsystemtap-steved-a5d8d92a7c3b1ad18d6da416d4bb08922578f502.tar.gz
systemtap-steved-a5d8d92a7c3b1ad18d6da416d4bb08922578f502.tar.xz
systemtap-steved-a5d8d92a7c3b1ad18d6da416d4bb08922578f502.zip
Add testcase for syscall.pipe.
-rw-r--r--testsuite/systemtap.syscall/pipe.c27
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;
+}