Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setjmp.h(3head) [sunos man page]

setjmp.h(3HEAD) 						      Headers							   setjmp.h(3HEAD)

NAME
setjmp.h, setjmp - stack environment declarations SYNOPSIS
#include <setjmp.h> DESCRIPTION
The <setjmp.h> header defines the array types jmp_buf and sigjmp_buf. Applications must define the appropriate feature test macro to enable the visibility of the symbols in this header. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
_longjmp(3C), setjmp(3C), attributes(5), standards(5) SunOS 5.10 10 Sep 2004 setjmp.h(3HEAD)

Check Out this Related Man Page

setjmp(3)						     Library Functions Manual							 setjmp(3)

Name
       setjmp, longjmp - non-local goto

Syntax
       #include <setjmp.h>

       int setjmp (env)
       jmp_buf env;

       void longjmp (env, val)
       jmp_buf env;
       int val;

Description
       The and functions help deal with errors and interrupts encountered in a low-level subroutine of a program.

       The function saves its stack environment in env (whose type, jmp_buf, is defined in the <setjmp.h> header file) for later use by It returns
       the value 0.

       The function restores the environment saved by the last call of with the corresponding env argument.   After  finishes,	program  execution
       continues  as if the corresponding call of (which must not itself have returned in the interim) had just returned the value val.  The func-
       tion cannot cause to return the value 0.  If is invoked with a second argument of 0, returns 1.	At the time of the second return from  all
       accessible  data  have  values as of the time is called.  However, global variables have the expected values.  For example, those as of the
       time of the

Examples
       #include <setjmp.h>

       jmp_buf env;
       int i = 0;
       main ()
       {
	    void exit();

	    if(setjmp(env) != 0) {
		 (void) printf("value of i on 2nd return from setjmp: %d0, i);
		 exit(0);
	    }
	    (void) printf("value of i on 1st return from setjmp: %d0, i);
	    i = 1;
	    g();
	    /*NOTREACHED*/
       }

       g()
       {
	    longjmp(env, 1);
	    /*NOTREACHED*/
       }

       If the a.out resulting from this C language code is run, the output is as follows:
       value of i on 1st return from setjmp:0

       value of i on 2nd return from setjmp:1
       Unexpected behavior occurs if is called without a previous call to or when the last such call was in a function which has since returned.

Restrictions
       The values of the registers on the second return from are register values at the time of the first call to not those of the Thus, variables
       in a given function can produce unexpected results in the presence of depending on whether they are register or stack variables.

See Also
       signal(2).

								       RISC								 setjmp(3)
Man Page

8 More Discussions You Might Find Interesting

1. Programming

problems with FORK() and WAITPID()

Dear All, I'm trying to write multithreading TCP Daemon which executes external program when new network connection arrives on a socket. After accept() I'm doing fork() for initiating of new child process, in which will be executed external program. After child creation I'm doing fork() again,... (3 Replies)
Discussion started by: Polkovnik
3 Replies

2. AIX

Installation error - '_UKJBLEN' undeclared here

Hi, I want to install a ghostscript file in AIX 5.3.. i confgiured it then gave make command. it has thrown the following error. -O2 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -fno-builtin -fno-common -DHAVE_STDINT_H... (0 Replies)
Discussion started by: meeraramanathan
0 Replies

3. Programming

Recursion

I want to halt a tail recursive function after certain validation. I want to come out of entire recursion without unwinding phase. How can i achieve that . The coding is done in C language. (5 Replies)
Discussion started by: joshighanshyam
5 Replies

4. Programming

Sinal-processing alarm()-function

hi programmers from all over the world, i am programming a simple program and want to deal with signals. i want to understand and work with the old signal-concept under unix, but i have a problem, hope you can help or knoew where i can get help. i use just one sig-handler, if a signal is... (1 Reply)
Discussion started by: xcoder44@gmx.de
1 Replies

5. Red Hat

Minicom with VMWare ESX Server

Hello! I have an ESX Server up and running. Now I want to connect a serial device to the COM Port. For that I need the minicom program. When I try "configure - make - make all" I get some errors. Can someone please explain to me, what the problems are: # ./configure checking for a... (3 Replies)
Discussion started by: Kickbit
3 Replies

6. Programming

Interesting issue with pthread_mutex_lock and siglongjmp in AIX 5.3 (and no other OS)

Executive summary: Code (posted below) cores in AIX 5.3, despite being compiled and run successfully on several other operating systems. Code is attempting to verify that pthread_mutex_lock can be successfully aborted by siglongjmp. I do not believe this is an unreasonable requirement. If... (1 Reply)
Discussion started by: DreamWarrior
1 Replies

7. OS X (Apple)

[Solved] links2 --enable-graphics from source, configure error: no graphics driver found.

Howdy I am trying to install links2 with graphics support on snow leopard 10.6.8 (xcode installed). I have had the program running last year, also installed from source - but then I had installed some image libraries with mac ports and fink - cannot reproduce that setup. Plus I would like to not... (6 Replies)
Discussion started by: butterbaerchen
6 Replies

8. UNIX for Beginners Questions & Answers

NTP synchronised problem in our Centos 7.6 node

Someone, please help on this issue:- Note : for security reason i didn't mention hostnames and ips. ============================================================================== # ntpstat unsynchronised polling server every 1024 s Ntpstat showing unsynchronised. ... (29 Replies)
Discussion started by: shanmugaraj
29 Replies