summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2019-03-26 16:47:37 +0900
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2019-03-26 16:50:26 +0900
commit417b4156e2f95d726d148d17351c8c90e595613d (patch)
treeaf66f498602d54869374339cd720e37fa833f917
parentd25fa2d2877be074a577d09d459a0a7d6220b63f (diff)
downloadDLT-daemon-417b4156e2f95d726d148d17351c8c90e595613d.tar.gz
doc: Do not allow DLT usage in forked child (#95)
Update the documents to adapt to behavior change of forked child. Relates to following commit: 18321f3 libdlt: Do not allow DLT usage in forked child (#95) Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
-rw-r--r--doc/dlt_cheatsheet.txt3
-rw-r--r--doc/dlt_user_manual.txt5
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/dlt_cheatsheet.txt b/doc/dlt_cheatsheet.txt
index 736142b..8babc2a 100644
--- a/doc/dlt_cheatsheet.txt
+++ b/doc/dlt_cheatsheet.txt
@@ -75,7 +75,8 @@ int main(int argc, const char\* argv\[\])
----
.Important notes:
-* If your application uses fork(), you may not call DLT_REGISTER_APP before fork(). And fork() should never be called after DLT_REGISTER_APP. This is because of state information and inter process communication channel to daemon would be copied to new process, but threads would be not. If you are not sure where you are calling DLT_REGISTER_APP() the first time, you can initialise the DLT user library by calling the initialisation routine directly.
+* DLT may not be used in a forked child until a variant of exec() is called,
+ because DLT is using non async-signal-safe functions.
----
dlt_user_init();
----
diff --git a/doc/dlt_user_manual.txt b/doc/dlt_user_manual.txt
index 54a252e..24c3a01 100644
--- a/doc/dlt_user_manual.txt
+++ b/doc/dlt_user_manual.txt
@@ -267,7 +267,8 @@ DLT_REGISTER_CONTEXT(mycontext,"TEST","Test Context for Logging");
----
.Important notes:
-* if fork() is called from an application after DLT_REGISTER_APP, dlt is reset in child process and user application needs to re-register application and contexts in child-process
+* DLT may not be used in a forked child until a variant of exec() is called,
+ because DLT is using non async-signal-safe functions.
* DLT_REGISTER_APP is asynchronous. It may take some milliseconds to establish the IPC channel. Because of this, you might lose messages if you log immediately after registering. Typically this is not a problem, but may arise especially with simple examples.
==== Use one of the DLT macros or the DLT function interface:
@@ -387,5 +388,3 @@ dlt_free(); | After using the application and contexts, they must be unregistere
Implementation specifics
* The implementation is multithread safe.
-* Initialize DLT application and contexts, then forking and using the forked process, will lead to unclear behavior (or in worst case to a crash), as the forked process uses another process id as the parent process. Instead, initialize the DLT application and contexts in the forked process.
-