From 3d652087604ca1c6a66d9fa319645aeec1cf1b7b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 23 Aug 2015 03:30:46 +0200 Subject: signal handlers that return should not modify errno MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/mds.texinfo | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'doc/info') diff --git a/doc/info/mds.texinfo b/doc/info/mds.texinfo index 03b2a1a..b2f1192 100644 --- a/doc/info/mds.texinfo +++ b/doc/info/mds.texinfo @@ -6460,6 +6460,28 @@ if no error occurs@footnote{@code{glibc} will not clear will be defined.}, and creates the alias @code{CLOCK_MONOTONIC_RAW} for @code{CLOCK_MONOTONIC} unless @code{CLOCK_MONOTONIC_RAW} is already defined. +The header file also ensure that all aliases for socket +protocol families and address families, for all definied +protocol families and address families. + +The header file @file{}, also +provides to macros to help write signal handlers. +@table @code +@item SIGHANDLER_START +Normal signal handlers should place this macro +at the top of the function. It will save the value +of @code{errno}. +@item SIGHANDLER_END +Normal signal handlers should place this macro +at the bottom of the function, or just before +any @code{return}. It will restore the value of +@code{errno} saved by @code{SIGHANDLER_START}. +@end table +These macros should be used, because signal handlers +should not modify @code{errno}. The one occasion where +exiting a signal handler with a modified @code{errno} +is acceptable, is when the signal handler exits the +program without returning. -- cgit v1.2.3-70-g09d2