From 0d0378a200f7347e6b8071bff8f519aaaa44bce1 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 6 Oct 2003 16:17:13 +0000 Subject: doc/ 2003-10-06 Marcus Brinkmann * gpgme.texi (Signal Handling): New section. gpgme/ 2003-10-06 Marcus Brinkmann * io.h (_gpgme_io_subsystem_init): New prototype. * posix-io.c (_gpgme_io_subsystem_init): Add function. (_gpgme_io_spawn): Do not fixup signal handler here. * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init. tests/ 2003-10-06 Marcus Brinkmann * gpg/t-thread1.c (thread_one): Do not call initialize_gpgme. Likewise. --- doc/ChangeLog | 4 ++++ doc/gpgme.texi | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'doc') diff --git a/doc/ChangeLog b/doc/ChangeLog index de523fea..0064e2d2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-10-06 Marcus Brinkmann + + * gpgme.texi (Signal Handling): New section. + 2003-09-14 Marcus Brinkmann * gpgme.texi (Multi Threading): Correct documentation on memory diff --git a/doc/gpgme.texi b/doc/gpgme.texi index c76916e3..48094548 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -107,6 +107,7 @@ Preparation * Using Automake:: Compiler options to be used the easy way. * Using Libtool:: Avoiding compiler options entirely. * Library Version Check:: Getting and verifying the library version. +* Signal Handling:: How @acronym{GPGME} affects signal handling. * Multi Threading:: How @acronym{GPGME} can be used in an MT environment. Protocols and Engines @@ -322,6 +323,7 @@ of the library are verified. * Using Automake:: Compiler options to be used the easy way. * Using Libtool:: Avoiding compiler options entirely. * Library Version Check:: Getting and verifying the library version. +* Signal Handling:: How @acronym{GPGME} affects signal handling. * Multi Threading:: How @acronym{GPGME} can be used in an MT environment. @end menu @@ -518,6 +520,34 @@ like this. @acronym{GPGME} can not do this for you because it would not be thread safe. +@node Signal Handling +@section Signal Handling +@cindex signals +@cindex signal handling + +The @acronym{GPGME} library communicates with child processes (the +crypto engines). If a child process dies unexpectedly, for example +due to a bug, or system problem, a @code{SIGPIPE} signal will be +delivered to the application. The default action is to abort the +program. To protect against this, @code{gpgme_check_version} sets the +@code{SIGPIPE} signal action to @code{SIG_IGN}, which means that the +signal will be ignored. + +@acronym{GPGME} will only do that if the signal action for +@code{SIGPIPE} is @code{SIG_DEF} at the time +@code{gpgme_check_version} is called. If it is something different, +@code{GPGME} will take no action. + +This means that if your application does not install any signal +handler for @code{SIGPIPE}, you don't need to take any precautions. +If you do install a signal handler for @code{SIGPIPE}, you must be +prepared to handle any @code{SIGPIPE} events that occur due to +@acronym{GPGME} writing to a defunct pipe. Furthermore, if your +application is multi-threaded, and you install a signal action for +@code{SIGPIPE}, you must make sure you do this either before +@code{gpgme_check_version} is called or afterwards. + + @node Multi Threading @section Multi Threading @cindex thread-safeness -- cgit v1.2.3