aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/seq_trace_SUITE_data
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/kernel/test/seq_trace_SUITE_data
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/kernel/test/seq_trace_SUITE_data')
-rw-r--r--lib/kernel/test/seq_trace_SUITE_data/Makefile.src3
-rw-r--r--lib/kernel/test/seq_trace_SUITE_data/echo_drv.c43
2 files changed, 46 insertions, 0 deletions
diff --git a/lib/kernel/test/seq_trace_SUITE_data/Makefile.src b/lib/kernel/test/seq_trace_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..c1bf142ccf
--- /dev/null
+++ b/lib/kernel/test/seq_trace_SUITE_data/Makefile.src
@@ -0,0 +1,3 @@
+all: echo_drv@dll@
+
+@SHLIB_RULES@
diff --git a/lib/kernel/test/seq_trace_SUITE_data/echo_drv.c b/lib/kernel/test/seq_trace_SUITE_data/echo_drv.c
new file mode 100644
index 0000000000..dcbb3348d8
--- /dev/null
+++ b/lib/kernel/test/seq_trace_SUITE_data/echo_drv.c
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include "erl_driver.h"
+
+static ErlDrvPort erlang_port;
+static ErlDrvData echo_start(ErlDrvPort, char *);
+static void echo_stop(ErlDrvData), echo_read(ErlDrvData, char*, int);
+
+static ErlDrvEntry echo_driver_entry = {
+ NULL,
+ echo_start,
+ echo_stop,
+ echo_read,
+ NULL,
+ NULL,
+ "echo_drv",
+ NULL
+};
+
+DRIVER_INIT(echo_drv)
+{
+ erlang_port = (ErlDrvPort)-1;
+ return &echo_driver_entry;
+}
+
+static ErlDrvData echo_start(ErlDrvPort port,char *buf)
+{
+ if (erlang_port != (ErlDrvPort)-1) {
+ return ERL_DRV_ERROR_GENERAL;
+ }
+ erlang_port = port;
+ return (ErlDrvData)port;
+}
+
+static void echo_read(ErlDrvData data, char *buf, int count)
+{
+ driver_output(erlang_port, buf, count);
+}
+
+static void echo_stop(ErlDrvData data)
+{
+ erlang_port = (ErlDrvPort)-1;
+}
+