From 24524dbd7867a27ba0550dbfd2c3fafed5ae0ca5 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson
Date: Wed, 6 Oct 2010 10:53:49 +0200
Subject: Documentation update to ETS and drivers
State more clearly that ETS functions will throw badarg if calling
process lacks access right. And that driver stop callback should free
memory allocted by start.
---
erts/doc/src/driver.xml | 7 +++++--
erts/doc/src/driver_entry.xml | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
(limited to 'erts')
diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml
index 006a6160de..db455312ec 100644
--- a/erts/doc/src/driver.xml
+++ b/erts/doc/src/driver.xml
@@ -196,11 +196,14 @@ static ErlDrvData start(ErlDrvPort port, char *command)
We call disconnect to log out from the database.
(This should have been done from Erlang, but just in case.)
We use the binary format only to return data to the emulator;
diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml
index e71b48bd92..dd949d4048 100644
--- a/erts/doc/src/driver_entry.xml
+++ b/erts/doc/src/driver_entry.xml
@@ -172,7 +172,7 @@ typedef struct erl_drv_entry {
added to the driver list.) The driver should return 0, or if
the driver can't initialize, -1.
- int (*start)(ErlDrvPort port, char* command)
+ ErlDrvData (*start)(ErlDrvPort port, char* command)
-
This is called when the driver is instantiated, when
open_port/2 is called. The driver should return a
@@ -188,7 +188,9 @@ typedef struct erl_drv_entry {
This is called when the port is closed, with
port_close/1 or Port ! {self(), close}. Note
that terminating the port owner process also closes the
- port.
+ port. If drv_data is a pointer to memory allocated in
+ start, then stop is the place to deallocate that
+ memory.
void (*output)(ErlDrvData drv_data, char *buf, int len)
-
--
cgit v1.2.3