From bf1a4a5a88fbbb21dec716896eff8319f2997ce7 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 2 Mar 2019 12:04:38 -0500 Subject: add documentation --- src/setjmp/siglongjmp.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/setjmp/siglongjmp.c') diff --git a/src/setjmp/siglongjmp.c b/src/setjmp/siglongjmp.c index 44b6d6ed..06edc641 100644 --- a/src/setjmp/siglongjmp.c +++ b/src/setjmp/siglongjmp.c @@ -1,10 +1,34 @@ #include +#include "signal.h" + +/** restore calling environment with signal mask **/ void siglongjmp(sigjmp_buf env, int val) { - (void)env; (void)val; - /* TODO */ + /* restor signal mask */ + + return longjmp(env, val); } + +/*** +restores the environment, including the saved signal mask (if any), of a +previous call to FUNCTION(sigsetjmp) and continues execution at the location of +the call to FUNCTION(sigsetjmp). + +All objects previously accessible at the time of the call to FUNCTION(sigsetjmp) +have the same values. Non-TYPE(volatile) objects of automatic storage duration +that have changed since the call to FUNCTION(sigsetjmp) have intederminate +values. + +When execution resumes at the point of the original call to FUNCTION(sigsetjmp), +the value specified by ARGUMENT(val) is returned. If 0 is specified, then the +return value is 1. +***/ + /* +UNDEFINED(There was no previous call to FUNCTION(setjmp)) +UNDEFINED(The function containing the previous call to FUNCTION(setjmp) is no longer executing) +UNDEFINED(THIS() is called from a nested signal handler) + POSIX(1) */ -- cgit v1.2.1